Skip to content

Configuration with Docker

Configure a TimescaleDB instance running in a Docker container

If you are running TimescaleDB in a Docker container, there are two different ways to modify your PostgreSQL configuration. You can edit the PostgreSQL configuration file inside the Docker container, or you can set parameters at the command prompt.

Edit the PostgreSQL configuration file inside Docker

Section titled “Edit the PostgreSQL configuration file inside Docker”

You can start the Docker container, and then use a text editor to edit the PostgreSQL configuration file directly. The configuration file requires one parameter per line. Blank lines are ignored, and you can use a # symbol at the beginning of a line to denote a comment.

  1. Start your Docker instance
    Terminal window
    docker start timescaledb
  2. Open a shell
    Terminal window
    docker exec -i -t timescaledb /bin/bash
  3. Open the configuration file in your preferred text editor
    Terminal window
    vi /var/lib/postgresql/data/postgresql.conf
  4. Restart the container to reload the configuration
    Terminal window
    docker restart timescaledb

If you don’t want to open the configuration file to make changes, you can also set parameters directly from the command prompt inside your Docker container, using the -c option. For example:

Terminal window
docker run -i -t timescale/timescaledb:latest-pg18 postgres -c max_wal_size=2GB