Docker Quickstart

This guide will help you get a basic TailStatic installation running on your server using Docker Compose. This is the fastest way to see the dashboard in action.

Prepare the Environment

Before you begin, install Docker on your operating system:

Linux

Follow the official Docker Engine installation steps for your distribution from the Docker documentation. After installation, verify Docker and Compose are available:

docker --version
docker compose version

If your user needs permission to run Docker commands without sudo, follow the post-install steps in the Docker documentation.

Mac

Install Docker Desktop for Mac and complete the setup wizard. Then open a new terminal and verify the installation:

docker --version
docker compose version

Windows

Install Docker Desktop for Windows and make sure WSL 2 is enabled if prompted. After installation, open PowerShell or Windows Terminal and verify Docker is ready:

docker --version
docker compose version

Once Docker is installed, create a directory for your TailStatic installation and navigate into it. This directory will host your app.

mkdir tailstatic && cd tailstatic

Next, create the two files needed for this setup:

  1. docker-compose.yml - defines the TailStatic services, ports, volumes, and shared environment settings.
  2. .env - stores the variable values referenced by the Compose file so you can keep host-specific paths and settings in one place.

The Docker Compose File

Create a file named docker-compose.yml.

nano docker-compose.yml

Paste the following content into it.

services:
  cms:
    image: tailstatic/tailstatic:latest
    container_name: tailstatic-container
    restart: unless-stopped
    depends_on:
      - tools
    ports:
      - "127.0.0.1:5014:5000"
    env_file:
      - .env
    environment:
      ASPNETCORE_ENVIRONMENT: Production
      TOOLS_APP_URL: http://tools:3000
    volumes:
      - ${TAILSTATIC_PARENT}:/app/data      
    healthcheck:
      test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:5000/ >/dev/null 2>&1 || exit 1"]
      interval: 30s
      timeout: 5s
      retries: 5
      start_period: 20s

  tools:
    image: tailstatic/tools:latest
    container_name: tailstatic-tools-container
    restart: unless-stopped
    env_file:
      - .env
    volumes:
      - ${TAILSTATIC_PARENT}:/app/data
    healthcheck:
      test: ["CMD", "node", "-e", "fetch('http://127.0.0.1:3000/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"]
      interval: 30s
      timeout: 5s
      retries: 5
      start_period: 20s

๐Ÿ’ก By default, above compose file configures TailStatic to listen on port 5000 inside Docker. However you can configure it to use any of the available ports.

The environment file

Create a file named .env in the same directory as docker-compose.yml. This file should contain the variables referenced by the Compose file. In this setup, TAILSTATIC_PARENT points to the folder on your host machine that should be mounted into both containers.

nano .env

Example .env contents:

TAILSTATIC_PARENT=/var/tailstatic-data
DASHBOARDDOMAIN=dashboard.yourdomain.com

Replace /var/tailstatic-data with a path where you would like TailStatic to store its data. Replace dashboard.yourdomain.com with your tailstatic dashboard domain. This domain will be configured in your web server to access TailStatic.

Starting the Services

Run the following command to download the images and start the containers in the background.

docker compose up -d

Verifying the Installation

You can check the status of your containers with:

docker compose ps

Both tailstatic and tailstatic-tools should show a status of "Up".

Next Steps

Now that you have Docker up and running, next step is to setup reverse proxy on your webserver to the Docker.

See Also