Skip to content

A shell script to install Postgres + Timescale on Ubuntu

Notifications You must be signed in to change notification settings

iProGamer/timescale-installation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 

Repository files navigation

timescale-installation

Ubuntu 22.04

A Shell Script to Install PostgreSQL 16 & Timescale 2.13 on Ubuntu 22.04

  1. Run the script
sudo apt update
sudo apt upgrade

sudo apt install gnupg postgresql-common apt-transport-https lsb-release wget
sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh

sudo echo "deb https://packagecloud.io/timescale/timescaledb/ubuntu/ $(lsb_release -c -s) main" | sudo tee /etc/apt/sources.list.d/timescaledb.list

sudo wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/timescaledb.gpg

sudo apt update

sudo apt install timescaledb-2-postgresql-16

sudo apt-get update

sudo apt-get install postgresql-client

sudo sh -c 'echo "shared_preload_libraries = '\''timescaledb'\''" >> /etc/postgresql/16/main/postgresql.conf'

sudo systemctl restart postgresql

sudo -u postgres psql
  1. Set the password for the "postgres" user:
    \password postgres

  2. Exit from PostgreSQL:
    \q

  3. Use "psql" client to connect to PostgreSQL:
    psql -U postgres -h localhost

  4. At the "psql" prompt, create an empty database. Our database is called "tsdb":
    CREATE database tsdb;

  5. Connect to the database you created:
    \c tsdb

  6. Add the TimescaleDB extension:
    CREATE EXTENSION IF NOT EXISTS timescaledb;

About

A shell script to install Postgres + Timescale on Ubuntu

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published