---
title: Uninstall TimescaleDB | Tiger Data Docs
description: Uninstall TimescaleDB without uninstalling PostgreSQL
---

You can uninstall TimescaleDB without uninstalling PostgreSQL. Choose your platform below.

- [Docker](#tab-panel-477)
- [Kubernetes](#tab-panel-478)
- [Linux](#tab-panel-479)
- [macOS](#tab-panel-480)
- [Windows](#tab-panel-481)

If you installed TimescaleDB using Docker, you can completely remove the TimescaleDB container, image, and optionally the data volumes.

1. **Stop the running container**

   Terminal window

   ```
   docker stop timescaledb
   ```

   If you named your container differently when you created it, replace `timescaledb` with your container name.

2. **Remove the container**

   Terminal window

   ```
   docker rm timescaledb
   ```

   This removes the container but preserves the data volume and the Docker image.

3. **List and remove the Docker image**

   1. See which TimescaleDB images you have installed:

      Terminal window

      ```
      docker images | grep timescale
      ```

      You see something like:

      Terminal window

      ```
      timescale/timescaledb-ha               pg18      1ec79f20f47d   9 hours ago    6.2GB
      ```

   2. Remove the TimescaleDB image:

      - [TimescaleDB-HA](#tab-panel-468)
      - [TimescaleDB light](#tab-panel-469)

      Terminal window

      ```
      docker rmi timescale/timescaledb-ha:pg18
      ```

      Terminal window

      ```
      docker rmi timescale/timescaledb:latest-pg18
      ```

      Replace `pg18` with your PostgreSQL version.

4. **(Optional) Remove the data**

   Warning

   This step permanently deletes all your database data. Only proceed if you’re sure you no longer need this data or have backed it up.

   List all Docker volumes:

   Terminal window

   ```
   docker volume ls
   ```

   If you used a named volume when creating your container, remove it:

   Terminal window

   ```
   docker volume rm <volume-name>
   ```

   If you used a host directory mount (with the `-v </a/local/data/folder>:/pgdata` flag), you can manually delete that directory:

   Terminal window

   ```
   rm -rf </a/local/data/folder>
   ```

If you deployed TimescaleDB on Kubernetes, you can completely remove all associated resources including the StatefulSet, Service, PersistentVolumeClaim, Secret, and application deployments.

1. **Back up any important data from your TimescaleDB instance**

   Terminal window

   ```
   kubectl exec -it timescaledb-0 -- pg_dump -U postgres postgres > backup.sql
   ```

2. **If you created a test pod during installation, delete it**

   Terminal window

   ```
   kubectl delete pod test-pod
   ```

3. **Remove any application deployments that connect to TimescaleDB**

   Terminal window

   ```
   kubectl delete deployment tigerdata-app
   ```

4. **Remove the service that exposes TimescaleDB within the cluster**

   Terminal window

   ```
   kubectl delete service timescaledb
   ```

5. **Delete the StatefulSet managing the TimescaleDB pods**

   Terminal window

   ```
   kubectl delete statefulset timescaledb
   ```

   This terminates the TimescaleDB pod.

6. **Delete the PersistentVolumeClaim**

   Warning

   Deleting the PersistentVolumeClaim permanently deletes all your database data. Ensure you have backed up any data you need before proceeding.

   Terminal window

   ```
   kubectl delete pvc tigerdata-pvc
   ```

7. **Remove the Kubernetes secret containing database credentials**

   Terminal window

   ```
   kubectl delete secret tigerdata-secret
   ```

8. **(Optional) Delete the namespace**

   If you created a dedicated namespace for TimescaleDB, you can remove it as well.

   Warning

   Only delete the namespace if you’re certain no other resources are using it. This will delete all resources in the namespace.

   Terminal window

   ```
   kubectl delete namespace tigerdata
   ```

Take the following steps to uninstall TimescaleDB based on your distribution:

- [Debian](#tab-panel-472)
- [Ubuntu](#tab-panel-473)
- [Red Hat](#tab-panel-474)
- [Fedora](#tab-panel-475)
- [Rocky](#tab-panel-476)

1. **Drop the TimescaleDB extension from your databases**

   1. Connect to each database where TimescaleDB is enabled and remove the extension:

      Terminal window

      ```
      sudo -u postgres psql -d <database_name>
      ```

   2. At the `psql` prompt:

      ```
      DROP EXTENSION timescaledb CASCADE;
      ```

   Repeat this for all databases with TimescaleDB enabled. To exit psql, type `\q`.

   Warning

   Using `CASCADE` will drop all TimescaleDB-specific objects including hypertables, continuous aggregates, and retention policies. Ensure you have backed up any data you want to keep.

2. **Remove TimescaleDB from shared\_preload\_libraries**

   Edit the PostgreSQL configuration file:

   Terminal window

   ```
   sudo vi /etc/postgresql/18/main/postgresql.conf
   ```

   Find the line with `shared_preload_libraries` and remove `timescaledb` from the list. For example, change:

   ```
   shared_preload_libraries = 'timescaledb'
   ```

   to:

   ```
   shared_preload_libraries = ''
   ```

   If there are other extensions in the list, keep them and only remove `timescaledb`.

3. **Restart PostgreSQL**

   Terminal window

   ```
   sudo systemctl restart postgresql
   ```

4. **Uninstall the TimescaleDB package**

   Terminal window

   ```
   sudo apt remove timescaledb-2-postgresql-18
   ```

   Replace `18` with your PostgreSQL version if different.

5. **Remove the TimescaleDB repository configuration**

   Terminal window

   ```
   sudo rm /etc/apt/sources.list.d/timescaledb.list
   sudo rm /etc/apt/trusted.gpg.d/timescaledb.gpg
   sudo apt update
   ```

6. **Remove dependencies**

   Remove unused dependencies installed with TimescaleDB:

   Warning

   This step may also remove PostgreSQL as a dependency.

   Terminal window

   ```
   sudo apt autoremove
   ```

1) **Drop the TimescaleDB extension from your databases**

   1. Connect to each database where TimescaleDB is enabled and remove the extension:

      Terminal window

      ```
      sudo -u postgres psql -d <database_name>
      ```

   2. At the `psql` prompt:

      ```
      DROP EXTENSION timescaledb CASCADE;
      ```

   Repeat this for all databases with TimescaleDB enabled. To exit psql, type `\q`.

   Warning

   Using `CASCADE` will drop all TimescaleDB-specific objects including hypertables, continuous aggregates, and retention policies. Ensure you have backed up any data you want to keep.

2) **Remove TimescaleDB from shared\_preload\_libraries**

   Edit the PostgreSQL configuration file:

   Terminal window

   ```
   sudo vi /etc/postgresql/18/main/postgresql.conf
   ```

   Find the line with `shared_preload_libraries` and remove `timescaledb` from the list. For example, change:

   ```
   shared_preload_libraries = 'timescaledb'
   ```

   to:

   ```
   shared_preload_libraries = ''
   ```

   If there are other extensions in the list, keep them and only remove `timescaledb`.

3) **Restart PostgreSQL**

   Terminal window

   ```
   sudo systemctl restart postgresql
   ```

4) **Uninstall the TimescaleDB package**

   Terminal window

   ```
   sudo apt remove timescaledb-2-postgresql-18
   ```

   Replace `18` with your PostgreSQL version if different.

5) **Remove the TimescaleDB repository configuration**

   Terminal window

   ```
   sudo rm /etc/apt/sources.list.d/timescaledb.list
   sudo rm /etc/apt/trusted.gpg.d/timescaledb.gpg
   sudo apt update
   ```

6) **Remove dependencies**

   Remove unused dependencies installed with TimescaleDB:

   Warning

   This step may also remove PostgreSQL as a dependency.

   Terminal window

   ```
   sudo apt autoremove
   ```

1. **Drop the TimescaleDB extension from your databases**

   1. Connect to each database where TimescaleDB is enabled and remove the extension:

      Terminal window

      ```
      sudo -u postgres psql -d <database_name>
      ```

   2. At the `psql` prompt:

      ```
      DROP EXTENSION timescaledb CASCADE;
      ```

   Repeat this for all databases with TimescaleDB enabled. To exit psql, type `\q`.

   Warning

   Using `CASCADE` will drop all TimescaleDB-specific objects including hypertables, continuous aggregates, and retention policies. Ensure you have backed up any data you want to keep.

2. **Remove TimescaleDB from shared\_preload\_libraries**

   Edit the PostgreSQL configuration file:

   Terminal window

   ```
   sudo vi /var/lib/pgsql/18/data/postgresql.conf
   ```

   Press `/` to search, type `shared_preload_libraries`, and press Enter. Press `i` to edit. Find the line with `shared_preload_libraries` and remove `timescaledb` from the list. For example, change:

   ```
   shared_preload_libraries = 'timescaledb'
   ```

   to:

   ```
   shared_preload_libraries = ''
   ```

   If there are other extensions in the list, keep them and only remove `timescaledb`. Press `Esc`, then type `:wq` and press Enter to save.

3. **Restart PostgreSQL**

   Terminal window

   ```
   sudo systemctl restart postgresql-18
   ```

   Replace `18` with your PostgreSQL version if different.

4. **Uninstall the TimescaleDB package**

   Terminal window

   ```
   sudo dnf remove timescaledb-2-postgresql-18
   ```

   Replace `18` with your PostgreSQL version if different.

5. **Remove the TimescaleDB repository configuration**

   Terminal window

   ```
   sudo rm /etc/yum.repos.d/timescale_timescaledb.repo
   ```

6. **Remove dependencies**

   Remove unused dependencies installed with TimescaleDB:

   Warning

   This step may also remove PostgreSQL as a dependency.

   Terminal window

   ```
   sudo dnf autoremove
   ```

1) **Drop the TimescaleDB extension from your databases**

   1. Connect to each database where TimescaleDB is enabled and remove the extension:

      Terminal window

      ```
      sudo -u postgres psql -d <database_name>
      ```

   2. At the `psql` prompt:

      ```
      DROP EXTENSION timescaledb CASCADE;
      ```

   Repeat this for all databases with TimescaleDB enabled. To exit psql, type `\q`.

   Warning

   Using `CASCADE` will drop all TimescaleDB-specific objects including hypertables, continuous aggregates, and retention policies. Ensure you have backed up any data you want to keep.

2) **Remove TimescaleDB from shared\_preload\_libraries**

   Edit the PostgreSQL configuration file:

   Terminal window

   ```
   sudo vi /var/lib/pgsql/18/data/postgresql.conf
   ```

   Press `/` to search, type `shared_preload_libraries`, and press Enter. Press `i` to edit. Find the line with `shared_preload_libraries` and remove `timescaledb` from the list. For example, change:

   ```
   shared_preload_libraries = 'timescaledb'
   ```

   to:

   ```
   shared_preload_libraries = ''
   ```

   If there are other extensions in the list, keep them and only remove `timescaledb`.

3) **Restart PostgreSQL**

   Terminal window

   ```
   sudo systemctl restart postgresql-18
   ```

   Replace `18` with your PostgreSQL version if different.

4) **Uninstall the TimescaleDB package**

   Terminal window

   ```
   sudo dnf remove timescaledb-2-postgresql-18
   ```

   Replace `18` with your PostgreSQL version if different.

5) **Remove the TimescaleDB repository configuration**

   Terminal window

   ```
   sudo rm /etc/yum.repos.d/timescale_timescaledb.repo
   ```

6) **Remove dependencies**

   Remove unused dependencies installed with TimescaleDB:

   Warning

   This step may also remove PostgreSQL as a dependency.

   Terminal window

   ```
   sudo dnf autoremove
   ```

1. **Drop the TimescaleDB extension from your databases**

   1. Connect to each database where TimescaleDB is enabled and remove the extension:

      Terminal window

      ```
      sudo -u postgres psql -d <database_name>
      ```

   2. At the `psql` prompt:

      ```
      DROP EXTENSION timescaledb CASCADE;
      ```

   Repeat this for all databases with TimescaleDB enabled. To exit psql, type `\q`.

   Warning

   Using `CASCADE` will drop all TimescaleDB-specific objects including hypertables, continuous aggregates, and retention policies. Ensure you have backed up any data you want to keep.

2. **Remove TimescaleDB from shared\_preload\_libraries**

   Edit the PostgreSQL configuration file:

   Terminal window

   ```
   sudo vi /var/lib/pgsql/18/data/postgresql.conf
   ```

   Press `/` to search, type `shared_preload_libraries`, and press Enter. Press `i` to edit. Find the line with `shared_preload_libraries` and remove `timescaledb` from the list. For example, change:

   ```
   shared_preload_libraries = 'timescaledb'
   ```

   to:

   ```
   shared_preload_libraries = ''
   ```

   If there are other extensions in the list, keep them and only remove `timescaledb`. Press `Esc`, then type `:wq` and press Enter to save.

3. **Restart PostgreSQL**

   Terminal window

   ```
   sudo systemctl restart postgresql-18
   ```

   Replace `18` with your PostgreSQL version if different.

4. **Uninstall the TimescaleDB package**

   Terminal window

   ```
   sudo dnf remove timescaledb-2-postgresql-18
   ```

   Replace `18` with your PostgreSQL version if different.

5. **Remove the TimescaleDB repository configuration**

   Terminal window

   ```
   sudo rm /etc/yum.repos.d/timescale_timescaledb.repo
   ```

6. **Remove dependencies**

   Remove unused dependencies installed with TimescaleDB:

   Warning

   This step may also remove PostgreSQL as a dependency.

   Terminal window

   ```
   sudo dnf autoremove
   ```

Uninstall self-hosted TimescaleDB with Homebrew or MacPorts.

- [Homebrew](#tab-panel-470)
- [MacPorts](#tab-panel-471)

1. **Drop the TimescaleDB extension from your databases**

   At the `psql` prompt, remove the TimescaleDB extension:

   ```
   DROP EXTENSION timescaledb CASCADE;
   ```

   Repeat this for all databases with TimescaleDB enabled. To exit psql, type `\q`.

2. **Remove TimescaleDB from shared\_preload\_libraries**

   Edit the PostgreSQL configuration file:

   Terminal window

   ```
   sudo vi /opt/homebrew/var/postgresql@17/postgresql.conf
   ```

   Find the line with `shared_preload_libraries` and remove `timescaledb` from the list. For example, change:

   ```
   shared_preload_libraries = 'timescaledb'
   ```

   to:

   ```
   shared_preload_libraries = ''
   ```

   If there are other extensions in the list, keep them and only remove `timescaledb`.

3. **Restart PostgreSQL**

   Terminal window

   ```
   brew services restart postgresql@17
   ```

4. **Uninstall TimescaleDB**

   Terminal window

   ```
   brew uninstall timescaledb-tools timescaledb
   ```

5. **Remove all the dependencies and related files**

   Terminal window

   ```
   brew untap timescale/tap
   ```

1) **Drop the TimescaleDB extension from your databases**

   At the `psql` prompt, remove the TimescaleDB extension:

   ```
   DROP EXTENSION timescaledb CASCADE;
   ```

2) **Remove TimescaleDB from shared\_preload\_libraries**

   At the command prompt, remove `timescaledb` from `shared_preload_libraries` in the `postgresql.conf` configuration file:

   Terminal window

   ```
   nano /opt/homebrew/var/postgresql@14/postgresql.conf
   shared_preload_libraries = ''
   ```

3) **Save the changes to the postgresql.conf file**

4) **Restart PostgreSQL**

   Terminal window

   ```
   port reload postgresql
   ```

5) **Uninstall TimescaleDB and the related dependencies**

   Terminal window

   ```
   port uninstall timescaledb --follow-dependencies
   ```

If you installed TimescaleDB on Windows using a package manager, you can uninstall it without removing PostgreSQL.

1. **Drop the TimescaleDB extension from your databases**

   1. Open Command Prompt or PowerShell and connect to each database where TimescaleDB is enabled:

      Terminal window

      ```
      psql -U postgres -d <database_name>
      ```

   2. At the `psql` prompt, remove the extension:

      ```
      DROP EXTENSION timescaledb CASCADE;
      ```

   Repeat this for all databases with TimescaleDB enabled. To exit psql, type `\q`.

   Warning

   Using `CASCADE` will drop all TimescaleDB-specific objects including hypertables, continuous aggregates, and retention policies. Ensure you have backed up any data you want to keep.

2. **Remove TimescaleDB from shared\_preload\_libraries**

   1. Open your PostgreSQL configuration file. The default location is:

      ```
      C:\Program Files\PostgreSQL\<version>\data\postgresql.conf
      ```

      You may need to run the editor as Administrator.

   2. Find the line with `shared_preload_libraries` and remove `timescaledb` from the list. For example, change:

      ```
      shared_preload_libraries = 'timescaledb'
      ```

      to:

      ```
      shared_preload_libraries = ''
      ```

      If there are other extensions in the list, keep them and only remove `timescaledb`.

   3. Save the file.

3. **Restart PostgreSQL**

   Terminal window

   ```
   Restart-Service postgresql-x64-18
   ```

   Replace `18` with your PostgreSQL version if different.

4. **Remove TimescaleDB binaries**

   Manually remove the TimescaleDB files from your PostgreSQL installation directory.

   1. Remove TimescaleDB library files. You may need to run PowerShell as Administrator:

      Terminal window

      ```
      Remove-Item "C:\Program Files\PostgreSQL\18\lib\timescaledb*.dll"
      ```

      Replace `18` with your PostgreSQL version if different.

   2. Remove TimescaleDB extension files:

      Terminal window

      ```
      Remove-Item -Recurse "C:\Program Files\PostgreSQL\18\share\extension\timescaledb*"
      ```

      Replace `18` with your PostgreSQL version if different.

   Note

   If you encounter permission errors, ensure you’re running PowerShell as Administrator.
