-
Notifications
You must be signed in to change notification settings - Fork 120
Update docker install and updater #4246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
billy-the-fish
merged 17 commits into
latest
from
4203-feedback-page-self-hostedlatestupgradesupgrade-docker
Jul 7, 2025
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
cabf67a
chore: first go.
billy-the-fish db032b5
tabs
atovpeko 9a80482
Merge branch 'latest' of github.com:timescale/docs into 4203-feedback…
atovpeko 9bce8ea
review
atovpeko 9b943fa
Merge branch 'latest' into 4203-feedback-page-self-hostedlatestupgrad…
atovpeko 6e3772f
Update self-hosted/upgrades/upgrade-docker.md
atovpeko a46c350
Update self-hosted/upgrades/upgrade-docker.md
atovpeko 8242bf0
Update self-hosted/upgrades/upgrade-docker.md
atovpeko 15cd39e
Update self-hosted/upgrades/upgrade-docker.md
atovpeko fcf105f
Update self-hosted/upgrades/upgrade-docker.md
atovpeko da9539b
updates on review
atovpeko fd3a2ba
Merge branch 'latest' into 4203-feedback-page-self-hostedlatestupgrad…
billy-the-fish 8b9be28
chore: change to force build update.
billy-the-fish 0db48fa
chore: force volume in the HA image.
billy-the-fish b60adc2
chore: and clean up.
billy-the-fish 061ee42
Merge branch 'latest' into 4203-feedback-page-self-hostedlatestupgrad…
billy-the-fish d0cacdc
Merge branch 'latest' into 4203-feedback-page-self-hostedlatestupgrad…
billy-the-fish File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,214 @@ | ||
<Tabs label="Install TimescaleDB with Docker"> | ||
|
||
<Tab title="TimescaleDB-HA"> | ||
|
||
<Procedure> | ||
In Terminal: | ||
|
||
1. **Run the $TIMESCALE_DB Docker image** | ||
|
||
The [TimescaleDB HA](https://hub.docker.com/r/timescale/timescaledb-ha) Docker image offers the most complete $TIMESCALE_DB experience. It uses [Ubuntu][ubuntu], includes [$TOOLKIT_LONG](https://github.com/timescale/timescaledb-toolkit), and support for PostGIS and Patroni. The latest release based on $PG 17 is `timescale/timescaledb-ha:pg17`: | ||
The [$TIMESCALE_DB HA](https://hub.docker.com/r/timescale/timescaledb-ha) Docker image offers the most complete | ||
$TIMESCALE_DB experience. It uses [Ubuntu][ubuntu], includes | ||
[$TOOLKIT_LONG](https://github.com/timescale/timescaledb-toolkit), and support for PostGIS and Patroni. | ||
|
||
```bash | ||
To install the latest release based on $PG 17: | ||
|
||
``` | ||
docker pull timescale/timescaledb-ha:pg17 | ||
``` | ||
|
||
The lighter-weight [TimescaleDB](https://hub.docker.com/r/timescale/timescaledb) non-ha Docker image uses [Alpine][alpine]. The latest release based on $PG 17 is `timescale/timescaledb:latest-pg17`. | ||
$TIMESCALE_DB is pre-created in the default $PG database and is added by default to any new database you create in this image. | ||
|
||
1. **Run the container** | ||
|
||
Replace `</a/local/data/folder>` with the path to the folder you want to keep your data in the following command. | ||
``` | ||
docker run -d --name timescaledb -p 5432:5432 -v </a/local/data/folder>:/pgdata -e PGDATA=/pgdata -e POSTGRES_PASSWORD=password timescale/timescaledb-ha:pg17 | ||
``` | ||
|
||
If you are running multiple container instances, change the port each Docker instance runs on. | ||
|
||
On UNIX-based systems, Docker modifies Linux IP tables to bind the container. If your system uses Linux Uncomplicated Firewall (UFW), Docker may | ||
[override your UFW port binding settings][override-binding]. To prevent this, add `DOCKER_OPTS="--iptables=false"` to `/etc/default/docker`. | ||
|
||
$TIMESCALE_DB is pre-created in the default $PG database in both the -ha and non-ha Docker images. | ||
By default, $TIMESCALE_DB is added to any new database you create in these images. | ||
1. **Connect to a database on your $PG instance** | ||
|
||
1. **Run the container** | ||
The default user and database are both `postgres`. You set the password in `POSTGRES_PASSWORD` in the previous step. The default command to connect to $PG is: | ||
|
||
```bash | ||
docker run -d --name timescaledb -p 5432:5432 -e POSTGRES_PASSWORD=password timescale/timescaledb-ha:pg17 | ||
psql -d "postgres://postgres:password@localhost/postgres" | ||
``` | ||
|
||
If you are running multiple container instances remember to change the port each Docker instance runs on. | ||
1. **Check that $TIMESCALE_DB is installed** | ||
|
||
```sql | ||
\dx | ||
``` | ||
|
||
You see the list of installed extensions: | ||
|
||
On UNIX based systems, Docker modifies Linux IP tables to bind the container. If your system uses | ||
Linux Uncomplicated Firewall (UFW), Docker may | ||
[override your UFW port binding settings](https://www.techrepublic.com/article/how-to-fix-the-docker-and-ufw-security-flaw/). | ||
To prevent this, add `DOCKER_OPTS="--iptables=false"` to `/etc/default/docker`. | ||
```sql | ||
Name | Version | Schema | Description | ||
---------------------+---------+------------+--------------------------------------------------------------------------------------- | ||
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language | ||
timescaledb | 2.20.3 | public | Enables scalable inserts and complex queries for time-series data (Community Edition) | ||
timescaledb_toolkit | 1.21.0 | public | Library of analytical hyperfunctions, time-series pipelining, and other SQL utilities | ||
(3 rows) | ||
``` | ||
|
||
1. **Connect to a database on your $PG instance** | ||
Press `q` to exit the list of extensions. | ||
|
||
</Procedure> | ||
|
||
## More Docker options | ||
|
||
If you want to access the container from the host but avoid exposing it to the | ||
outside world, you can bind to `127.0.0.1` instead of the public interface, using this command: | ||
|
||
```bash | ||
docker run -d --name timescaledb -p 127.0.0.1:5432:5432 \ | ||
-v </a/local/data/folder>:/pgdata -e PGDATA=/pgdata -e POSTGRES_PASSWORD=password timescale/timescaledb-ha:pg17 | ||
``` | ||
|
||
If you don't want to install `psql` and other $PG client tools locally, | ||
or if you are using a Microsoft Windows host system, you can connect using the | ||
version of `psql` that is bundled within the container with this command: | ||
|
||
```bash | ||
docker exec -it timescaledb psql -U postgres | ||
``` | ||
|
||
When you install $TIMESCALE_DB using a Docker container, the $PG settings | ||
are inherited from the container. In most cases, you do not need to adjust them. | ||
However, if you need to change a setting, you can add `-c setting=value` to your | ||
Docker `run` command. For more information, see the | ||
[Docker documentation][docker-postgres]. | ||
|
||
The link provided in these instructions is for the latest version of $TIMESCALE_DB | ||
on $PG 17. To find other Docker tags you can use, see the [Dockerhub repository][dockerhub]. | ||
|
||
## View logs in Docker | ||
|
||
If you have $TIMESCALE_DB installed in a Docker container, you can view your logs | ||
using Docker, instead of looking in `/var/lib/logs` or `/var/logs`. For more | ||
information, see the [Docker documentation on logs][docker-logs]. | ||
|
||
</Tab> | ||
|
||
<Tab title="TimescaleDB light"> | ||
|
||
<Procedure> | ||
|
||
1. **Run the $TIMESCALE_DB Docker image** | ||
|
||
The light-weight [$TIMESCALE_DB](https://hub.docker.com/r/timescale/timescaledb) Docker image uses [Alpine][alpine] and does not contain [$TOOLKIT_LONG](https://github.com/timescale/timescaledb-toolkit) or support for PostGIS and Patroni. | ||
|
||
To install the latest release based on $PG 17: | ||
|
||
``` | ||
docker pull timescale/timescaledb:latest-pg17 | ||
``` | ||
|
||
$TIMESCALE_DB is pre-created in the default $PG database and added by default to any new database you create in this image. | ||
|
||
|
||
1. **Run the container** | ||
|
||
``` | ||
docker run -d --name timescaledb -p 5432:5432 -e POSTGRES_PASSWORD=password timescale/timescaledb:latest-pg17 | ||
``` | ||
|
||
If you are running multiple container instances, change the port each Docker instance runs on. | ||
|
||
On UNIX-based systems, Docker modifies Linux IP tables to bind the container. If your system uses Linux Uncomplicated Firewall (UFW), Docker may [override your UFW port binding settings][override-binding]. To prevent this, add `DOCKER_OPTS="--iptables=false"` to `/etc/default/docker`. | ||
|
||
1. **Connect to a database on your $PG instance** | ||
|
||
The default user and database are both `postgres`. You set the password in `POSTGRES_PASSWORD` in the previous step. The default command to connect to $PG in this image is: | ||
|
||
```bash | ||
psql -d "postgres://postgres:password@localhost/postgres" | ||
``` | ||
|
||
The default user and database are both `postgres`. You set the password in | ||
`POSTGRES_PASSWORD` in the previous step. The default command to connect to $PG in this image is: | ||
|
||
1. **Check that $TIMESCALE_DB is installed** | ||
|
||
```sql | ||
\dx | ||
``` | ||
|
||
You see the list of installed extensions: | ||
You see the list of installed extensions: | ||
|
||
```sql | ||
List of installed extensions | ||
Name | Version | Schema | Description | ||
---------------------+---------+------------+--------------------------------------------------------------------------------------- | ||
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language | ||
timescaledb | 2.17.2 | public | Enables scalable inserts and complex queries for time-series data (Community Edition) | ||
timescaledb_toolkit | 1.19.0 | public | Library of analytical hyperfunctions, time-series pipelining, and other SQL utilities | ||
(3 rows) | ||
timescaledb | 2.20.3 | public | Enables scalable inserts and complex queries for time-series data (Community Edition) | ||
``` | ||
Press q to exit the list of extensions. | ||
|
||
Press `q` to exit the list of extensions. | ||
|
||
## More Docker options | ||
|
||
If you want to access the container from the host but avoid exposing it to the | ||
outside world, you can bind to `127.0.0.1` instead of the public interface, using this command: | ||
|
||
```bash | ||
docker run -d --name timescaledb -p 127.0.0.1:5432:5432 \ | ||
-e POSTGRES_PASSWORD=password timescale/timescaledb:latest-pg17 | ||
``` | ||
|
||
If you don't want to install `psql` and other $PG client tools locally, | ||
or if you are using a Microsoft Windows host system, you can connect using the | ||
version of `psql` that is bundled within the container with this command: | ||
|
||
```bash | ||
docker exec -it timescaledb psql -U postgres | ||
``` | ||
|
||
Existing containers can be stopped using `docker stop` and started again with | ||
`docker start` while retaining their volumes and data. When you create a new | ||
container using the `docker run` command, by default you also create a new data | ||
volume. When you remove a Docker container with `docker rm`, the data volume | ||
persists on disk until you explicitly delete it. You can use the `docker volume | ||
ls` command to list existing docker volumes. If you want to store the data from | ||
your Docker container in a host directory, or you want to run the Docker image | ||
on top of an existing data directory, you can specify the directory to mount a | ||
data volume using the `-v` flag: | ||
|
||
```bash | ||
docker run -d --name timescaledb -p 5432:5432 \ | ||
-v /your/data/dir:/home/postgres/pgdata/data \ | ||
-e POSTGRES_PASSWORD=password timescale/timescaledb:latest-pg17 | ||
``` | ||
|
||
When you install $TIMESCALE_DB using a Docker container, the $PG settings | ||
are inherited from the container. In most cases, you do not need to adjust them. | ||
However, if you need to change a setting, you can add `-c setting=value` to your | ||
Docker `run` command. For more information, see the | ||
[Docker documentation][docker-postgres]. | ||
|
||
The link provided in these instructions is for the latest version of $TIMESCALE_DB | ||
on $PG 16. To find other Docker tags you can use, see the [Dockerhub repository][dockerhub]. | ||
|
||
## View logs in Docker | ||
|
||
If you have $TIMESCALE_DB installed in a Docker container, you can view your logs | ||
using Docker, instead of looking in `/var/lib/logs` or `/var/logs`. For more | ||
billy-the-fish marked this conversation as resolved.
Show resolved
Hide resolved
|
||
information, see the [Docker documentation on logs][docker-logs]. | ||
|
||
</Procedure> | ||
|
||
</Tab> | ||
|
||
</Tabs> | ||
|
||
[config]: /self-hosted/:currentVersion:/configuration/ | ||
[alpine]: https://alpinelinux.org/ | ||
[ubuntu]: https://ubuntu.com | ||
[override-binding]: https://www.techrepublic.com/article/how-to-fix-the-docker-and-ufw-security-flaw/ | ||
[alpine]: https://alpinelinux.org/ | ||
[config]: /self-hosted/:currentVersion:/configuration/ | ||
[docker-postgres]: https://hub.docker.com/_/postgres | ||
[dockerhub]: https://hub.docker.com/r/timescale/timescaledb/tags?page=1&ordering=last_updated | ||
[ubuntu]: https://ubuntu.com | ||
[docker-logs]: https://docs.docker.com/engine/logging/ | ||
[install-from-source]: /self-hosted/:currentVersion:/install/installation-source/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.