Install self-hosted TimescaleDB on Red Hat-based systems

You can host TimescaleDB yourself on your Red Hat, CentOS, or Fedora system. These instructions use the yum package manager on these distributions:

  • Red Hat Enterprise Linux 7
  • Red Hat Enterprise Linux 8
  • CentOS 7
  • CentOS 8
  • Fedora 33
  • Fedora 34
  • Fedora 35


If you have already installed PostgreSQL using a method other than the yum or dnf 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 Red Hat-based systems

  1. At the command prompt, as root, add the PostgreSQL third party repository to get the latest PostgreSQL packages:

  2. Create the Timescale repository:

  3. Update your local repository list:

    yum update
  4. Install TimescaleDB:

    yum install timescaledb-2-postgresql-14

When you have completed the installation, you need to configure your database so that you can use it. The easiest way to do this is to run the timescaledb-tune script, which is included with the timescaledb-tools package. For more information, see the configuration section.

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 our installing psql section.

Setting up the TimescaleDB extension

  1. Initialize the database:

    /usr/pgsql-14/bin/postgresql-14-setup initdb
  2. Enable and start the service:

    systemctl enable postgresql-14
    systemctl start postgresql-14
  3. Connect to the PostgreSQL instance as the postgres superuser:

    su postgres -c psql

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

    psql (13.3, server 12.8 (Ubuntu 12.8-1.pgdg21.04+1))
    SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off)
    Type "help" for help.
  4. At the psql prompt, create an empty database. Our database is called example:

    CREATE database example;
  5. Connect to the database you created:

    \c example
  6. Add the TimescaleDB extension:

  7. You can now connect to your database using this command:

    su postgres -c 'psql -d example'

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

tsdb=> \dx
List of installed extensions
-[ RECORD 1 ]------------------------------------------------------------------
Name        | plpgsql
Version     | 1.0
Schema      | pg_catalog
Description | PL/pgSQL procedural language
-[ RECORD 2 ]------------------------------------------------------------------
Name        | timescaledb
Version     | 2.6.1
Schema      | public
Description | Enables scalable inserts and complex queries for time-series data


Where to next

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

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

Found an issue on this page?

Report an issue!


Related Content