How to Install Postiz with Docker Compose on Debian 12

Postiz is a powerful, self-hosted social media management tool. This guide uses Docker Compose for the simplest installation on your Debian 12.

Prerequisites

  • A Debian 12 VPS or server.
  • A user with sudo privileges.

Install Docker Engine and Docker Compose Plugin

This setup installs the Docker Engine and the modern docker-compose-plugin from the official Docker repository.

Update system and install dependencies

sudo apt update
sudo apt install ca-certificates curl gnupg lsb-release -y

Add Docker's GPG key

sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL [https://download.docker.com/linux/debian/gpg](https://download.docker.com/linux/debian/gpg) | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg

Add the Docker repository

echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] [https://download.docker.com/linux/debian](https://download.docker.com/linux/debian) \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Install Docker and the Compose Plugin

sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin -y

Verify Docker installation

sudo docker run hello-world

Prepare Postiz Configuration

Create the project directory and navigate into it.

mkdir postiz
cd postiz

Create the Docker Compose File

Create the configuration file for Postiz, its database (Postgres), and its cache (Redis). You must change the JWT_SECRET value.

nano docker-compose.yml

Paste the following content:

version: '3.9'
services:
  postiz:
    image: ghcr.io/gitroomhq/postiz-app:latest
    container_name: postiz
    restart: always
    environment:
      # --- REQUIRED SETTINGS (CONFIGURED FOR YOUR IP) ---
      MAIN_URL: "[http://Your_IP_Address:5000](http://Your_IP_Address:5000)"
      FRONTEND_URL: "[http://Your_IP_Address:5000](http://Your_IP_Address:5000)"
      NEXT_PUBLIC_BACKEND_URL: "[http://Your_IP_Address:5000/api](http://Your_IP_Address:5000/api)"
      NOT_SECURED: "true" # !! SET TO TRUE FOR RAW IP/NON-HTTPS ACCESS !!
      JWT_SECRET: "A_LONG_RANDOM_STRING_CHANGE_THIS_NOW" # <-- **CHANGE THIS VALUE**

      # Database/Redis Connection Settings
      DATABASE_URL: "postgresql://postiz-user:postiz-password@postiz-postgres:5432/postiz-db-local"
      REDIS_URL: "redis://postiz-redis:6379"

      # Storage and General Settings
      STORAGE_PROVIDER: "local"
      UPLOAD_DIRECTORY: "/uploads"
      IS_GENERAL: "true"
      DISABLE_REGISTRATION: "false" # Change to "true" after first admin user is created

    volumes:
      - postiz-config:/config/
      - postiz-uploads:/uploads/
    ports:
      - "5000:5000" # Exposes Postiz on port 5000
    networks:
      - postiz-network
    depends_on:
      postiz-postgres:
        condition: service_healthy
      postiz-redis:
        condition: service_healthy

  postiz-postgres:
    image: postgres:15-alpine
    container_name: postiz-postgres
    restart: always
    environment:
      POSTGRES_USER: "postiz-user"
      POSTGRES_PASSWORD: "postiz-password"
      POSTGRES_DB: "postiz-db-local"
    volumes:
      - postiz-postgres-data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postiz-user -d postiz-db-local"]
      interval: 10s
      timeout: 5s
      retries: 5
    networks:
      - postiz-network

  postiz-redis:
    image: redis:7-alpine
    container_name: postiz-redis
    restart: always
    volumes:
      - postiz-redis-data:/data
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 10s
      timeout: 5s
      retries: 5
    networks:
      - postiz-network

networks:
  postiz-network:
    driver: bridge

volumes:
  postiz-config:
  postiz-uploads:
  postiz-postgres-data:
  postiz-redis-data:

Start and Access Postiz

Use the Docker Compose plugin to start all services in the background.

# Start the stack
docker compose up -d

# Check status (optional)
docker compose ps

Access Postiz: Visit the following address in your web browser

http://Your_IP_Address:5000

Security Step (Administrator Setup)

After creating your first admin user, stop the containers, edit the docker-compose.yml to disable public registration, and restart the stack:

docker compose down
nano docker-compose.yml # Change DISABLE_REGISTRATION: "false" to "true"
docker compose up -d

CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME for 10% off!

1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month

Available Locations: LAX | MIA | ATL | FRA | AMS