You can host TimescaleDB yourself on your Apple macOS system. These instructions use a Homebrew or MacPorts installer on these versions:
- Apple macOS 10.15 Catalina
- Apple macOS 11 Big Sur
- Apple macOS 12 Monterey
Important
Before you begin installing TimescaleDB, make sure you have installed PostgreSQL version 12 or later.
Warning
If you have already installed PostgreSQL using a method other than Homebrew, you could encounter errors following these instructions. It is safest to remove any existing PostgreSQL installations before you begin. If you want to keep your current PostgreSQL installation, do not install TimescaleDB using this method. Install from source instead.
You can use Homebrew to install TimescaleDB on macOS-based systems.
Install Homebrew, if you don't already have it:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"For more information about Homebrew, including installation instructions, see the Homebrew documentation.
At the command prompt, add the TimescaleDB Homebrew tap:
brew tap timescale/tapInstall TimescaleDB:
brew install timescaledbRun the
timescaledb-tune
script to configure your database:timescaledb-tune --quiet --yesChange to the directory where the setup script is located. It is typically, located at
/opt/homebrew/Cellar/timescaledb/<VERSION>/bin/
, where<VERSION>
is the version oftimescaledb
that you installed:cd /opt/homebrew/Cellar/timescaledb/<VERSION>/bin/Run the setup script to complete installation.
./timescaledb_move.sh
When you have PostgreSQL and TimescaleDB installed, you can connect to it from
your local system using the psql
command-line utility.
Install
psql
:brew install libpqUpdate your path to include the
psql
tool.brew link --force libpqOn Intel chips, the symbolic link is added to
/usr/local/bin
. On Apple Silicon, the symbolic link is added to/opt/homebrew/bin
.
You can use MacPorts to install TimescaleDB on macOS-based systems.
Install MacPorts by downloading and running the package installer. For more information about MacPorts, including installation instructions, see the MacPorts documentation.
Install TimescaleDB:
sudo port install timescaledbOptionalView the files that were installed:
port contents timescaledb
Important
MacPorts does not install the timescaledb-tools
to run the timescaledb-tune
script. For more information about installing and using the tool, see timescaledb-tune
section.
When you have PostgreSQL and TimescaleDB installed, you can connect to it from
your local system using the psql
command-line utility.
Connect to PostgreSQL from your local system using the psql
command-line
utility and set up the TimescaleDB extension.
On your local system, at the command prompt, connect to the PostgreSQL instance as the
postgres
superuser:psql -U postgres -h localhostIf your connection is successful, you'll see a message like this, followed by the
psql
prompt:psql (14.4)Type "help" for help.At the
psql
prompt, create an empty database namedtsdb
:CREATE database tsdb;Connect to the
tsdb
database that you created:\c tsdbAdd the TimescaleDB extension:
CREATE EXTENSION IF NOT EXISTS timescaledb;Check that the TimescaleDB extension is installed by using the
\dx
command at thepsql
prompt. Output is similar to:tsdb-# \dxList of installed extensionsName | Version | Schema | Description-------------+---------+------------+-------------------------------------------------------------------plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural languagetimescaledb | 2.7.0 | public | Enables scalable inserts and complex queries for time-series data(2 rows)
After you have created the extension and the database, you can connect to your database directly using this command:
psql -U postgres -h localhost -d tsdb
Now that you have your first Timescale database up and running, you can check out the Use Timescale section, and find out what you can do with it.
If you want to work through some tutorials to help you get up and running with Timescale and time-series data, check out the tutorials section.
Keywords
Found an issue on this page?
Report an issue!