Install self-hosted TimescaleDB on archlinux-based systems

You can host TimescaleDB yourself, on your Arch Linux system. These instructions use the pacman package manager.

warning

If you have already installed PostgreSQL using a method other than the pacman package manager, 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.

Installing self-hosted TimescaleDB on archlinux-based systems

  1. Install TimescaleDB and timescaledb-tune:

    1. sudo pacman -Syu timescaledb timescaledb-tune
  2. Initialize the database as the postgres user:

    1. sudo -u postgres initdb --locale=en_US.UTF-8 --encoding=UTF8 -D /var/lib/postgres/data --data-checksums
  3. Run timescaledb-tune to adjust your postgresql.conf file, to use TimescaleDB as PostgreSQL extension:

    1. sudo timescaledb-tune
  4. Enable and start the service:

    1. sudo systemctl enable postgresql.service
    2. sudo systemctl start postgresql.service

Set up the TimescaleDB extension

When you have PostgreSQL and TimescaleDB installed, you can connect to it from your local system using the psql command-line utility. This is the same tool you might have used to connect to PostgreSQL before, but if you haven’t installed it yet, check out the installing psql section.

Setting up the TimescaleDB extension

  1. On your local system, at the command prompt, connect to the PostgreSQL instance as the postgres superuser:

    1. sudo -u postgres psql

    If your connection is successful, you’ll see a message like this, followed by the psql prompt:

    1. psql (14.3)
    2. Type "help" for help.
  2. At the psql prompt, create an empty database. This database is called tsdb:

    1. CREATE database tsdb;
  3. Connect to the database you created:

    1. \c tsdb
  4. Add the TimescaleDB extension:

    1. CREATE EXTENSION IF NOT EXISTS timescaledb;
  5. You can now connect to your database using this command:

    1. sudo -u postgres psql tsdb

You can check that the TimescaleDB extension is installed by using the \dx command at the psql prompt. It looks like this:

  1. tsdb=# \dx
  2. List of installed extensions
  3. Name | Version | Schema | Description
  4. -------------+---------+------------+-------------------------------------------------------------------
  5. plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
  6. timescaledb | 2.7.0 | public | Enables scalable inserts and complex queries for time-series data
  7. (2 rows)

Where to next

Now that you have your first TimescaleDB database up and running, you can check out the TimescaleDB section in the documentation, 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 TimescaleDB and time-series data, check out the tutorials section.

You can always contact us if you need help working something out, or if you want to have a chat.