Configuration with Docker

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

You can start the Dockert 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.

Editing the PostgreSQL configuration file inside Docker

  1. Start your Docker instance:

    1. docker start timescaledb
  2. Open a shell:

    1. docker exec -i -t timescaledb /bin/bash
  3. Open the configuration file in your opreferred text editor. In this example, we are using ther Vi editor:

    1. vi /var/lib/postgresql/data/postgresql.conf
  4. Restart the container to reload the configuration:

    1. docker restart timescaledb

Setting parameters at the command prompt

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:

  1. docker run -i -t timescale/timescaledb:latest-pg10 postgres -c max_wal_size=2GB