Setup TimescaleDB with Docker Compose: A Step-by-Step Guide

This tutorial will guide you through setting up and using TimescaleDB using Docker Compose.

Prerequisites

  • Docker installed on your system
  • Docker Compose installed on your system

Getting Started

  1. Start the TimescaleDB Container

    Navigate to the directory containing the docker-compose.yml file and run:

    docker-compose up -d
    

    This will start TimescaleDB in detached mode. The database will be accessible on port 5432.

  2. Connection Details

    • Host: localhost
    • Port: 5432
    • Database: timescale
    • Username: timescale
    • Password: timescale
  3. Verify the Installation

    You can connect to the database using psql or any PostgreSQL client:

    docker exec -it timescale-timescaledb-1 psql -U timescale -d timescale
    

    Once connected, you can verify TimescaleDB is properly installed:

    SELECT default_version, installed_extensions FROM pg_available_extensions WHERE name = 'timescaledb';
    
Continue reading “Setup TimescaleDB with Docker Compose: A Step-by-Step Guide”