Postiz Setup Guide: Schedule Smarter with This Open-Source AI Tool

7月7日 Published inAI Tools

Postiz is an open-source social media management platform built with a focus on AI automation. It allows you to plan and schedule posts across multiple platforms from a single interface, eliminating the need to manage several different dashboards. The tool analyzes audience activity to suggest optimal posting times, offers copy improvements, and can generate text snippets to streamline your workflow.

Core Features

AI-Driven Creation & Scheduling Use AI to draft both text and imagery, then organize your content using a visual calendar. The interface supports drag-and-drop functionality for quick rescheduling.

Performance Analytics Monitor key metrics including views, engagement rates, video plays, and follower growth. These insights help identify which content resonates most with your audience.

Community Content Marketplace Access a marketplace of pre-made posts tailored to specific niches such as real estate, fashion, health, and beauty.

Team Collaboration Invite team members to collaborate on campaigns. The system supports internal commenting and approval workflows to keep everyone aligned.

Postiz Installation

Docker Compose (Recommended)

Prerequisites Docker is the primary requirement for this deployment. This guide was verified on a clean Ubuntu 24.04 VM with 2GB RAM and 2 vCPUs.

Network Considerations

HTTPS and Security By default, login cookies use the Secure flag. You should run Postiz behind a reverse proxy like Caddy or Nginx to manage SSL certificates. For local testing where HTTPS is unavailable, you must add NOT_SECURED=true to your .env file. Do not use this setting in a production environment.

Port Mapping The container uses port 5000/tcp as its single entry point. Your reverse proxy should point here. Internal services like the frontend (port 4200), backend (port 3000), Postgres (port 5432), and Redis (port 6379) are contained within the Docker network and do not need to be exposed to the host.

Environment Variables You can define variables using any of these three methods:

  1. Hardcoded directly within the docker-compose.yml file.
  2. Stored in a postiz.env file and mounted to /config inside the container.
  3. Placed in a standard .env file in the same directory as your docker-compose.yml.

Sample Configuration Below is a standard docker-compose.yml configuration:

services:
  postiz:
    image: ghcr.io/gitroomhq/postiz-app:latest
    container_name: postiz
    restart: always
    environment:
      MAIN_URL: "https://postiz.your-server.com"
      FRONTEND_URL: "https://postiz.your-server.com"
      NEXT_PUBLIC_BACKEND_URL: "https://postiz.your-server.com/api"
      JWT_SECRET: "generate-a-long-random-string-here"
      DATABASE_URL: "postgresql://postiz-user:postiz-password@postiz-postgres:5432/postiz-db-local"
      REDIS_URL: "redis://postiz-redis:6379"
      BACKEND_INTERNAL_URL: "http://localhost:3000"
      IS_GENERAL: "true"
      STORAGE_PROVIDER: "local"
      UPLOAD_DIRECTORY: "/uploads"
      NEXT_PUBLIC_UPLOAD_DIRECTORY: "/uploads"
    volumes:
      - postiz-config:/config/
      - postiz-uploads:/uploads/
    ports:
      - 5000:5000
    networks:
      - postiz-network
    depends_on:
      postiz-postgres:
        condition: service_healthy
      postiz-redis:
        condition: service_healthy

  postiz-postgres:
    image: postgres:17-alpine
    container_name: postiz-postgres
    restart: always
    environment:
      POSTGRES_PASSWORD: postiz-password
      POSTGRES_USER: postiz-user
      POSTGRES_DB: postiz-db-local
    volumes:
      - postgres-volume:/var/lib/postgresql/data
    networks:
      - postiz-network
    healthcheck:
      test: pg_isready -U postiz-user -d postiz-db-local
      interval: 10s
      timeout: 3s
      retries: 3

  postiz-redis:
    image: redis:7.2
    container_name: postiz-redis
    restart: always
    healthcheck:
      test: redis-cli ping
      interval: 10s
      timeout: 3s
      retries: 3
    volumes:
      - postiz-redis-data:/data
    networks:
      - postiz-network

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

networks:
  postiz-network:

Launch Steps

  1. Save the configuration above as docker-compose.yml.
  2. Execute docker compose up -d to start the services.
  3. If you update any environment variables, run docker compose down followed by docker compose up -d to apply the changes.
  4. Access the application at https://postiz.your-server.com once the stack is fully operational.

Service Segmentation By default, the main container runs the frontend, backend, worker, and cron services simultaneously. For larger deployments, you can isolate these services by setting the POSTIZ_APPS variable:

  • Frontend only: POSTIZ_APPS="frontend"
  • Backend only: POSTIZ_APPS="backend"
  • Worker and cron only: POSTIZ_APPS="worker cron"

Docker (Standalone)

This method is only recommended if you require specific manual networking configurations.

Environment Variables Create a .env file and ensure the container can access it via the /config mount.

Container Creation Ensure your PostgreSQL and Redis instances are already running, then execute:

docker create --name postiz -v postiz-uploads:/uploads/ -v postiz-config:/config/ -p 5000:5000 ghcr.io/gitroomhq/postiz-app:latest

Adjust the volume paths to match your local file system.

Kubernetes Helm

A Helm chart is available but is currently under active development. It is OCI-compliant, meaning it can be pulled directly without adding a traditional repository. It is compatible with Flux CD or standard Helm OCI commands.

Repository: https://github.com/gitroomhq/postiz-helmchart
Values Reference: https://github.com/gitroomhq/postiz-helmchart/blob/main/charts/postiz/values.yaml

Development Environment

For those who need maximum flexibility while Docker images are being refined, a manual development setup is the best option.

Supported OS

  • macOS
  • Linux (Verified on Fedora 40)

Note: Windows and WSL environments often encounter compatibility issues. Official support for Windows is currently limited.

Prerequisites

  • Node.js 18+
  • PostgreSQL (Running via Docker is recommended for ease of use)
  • Redis (Running via Docker is recommended)

Installation Steps

  1. Initialize Dependencies Option A: Start Postgres and Redis as standalone containers.

    docker run -e POSTGRES_USER=root -e POSTGRES_PASSWORD=your_password --name postgres -p 5432:5432 -d postgres
    docker run --name redis -p 6379:6379 -d redis
    

    Option B: Use the provided development compose file.

    docker compose -f "docker-compose.dev.yaml" up
    
  2. Clone the Source Code

    git clone https://github.com/gitroomhq/postiz-app.git
    
  3. Configure Environment Variables Copy .env.example to .env and update the following fields:

    DATABASE_URL="postgresql://postiz-user:postiz-password@localhost:5432/postiz-db-local"
    REDIS_URL="redis://localhost:6379"
    JWT_SECRET="a-very-long-random-string"
    FRONTEND_URL="http://localhost:4200"
    NEXT_PUBLIC_BACKEND_URL="http://localhost:3000"
    BACKEND_INTERNAL_URL="http://localhost:3000"
    
    UPLOAD_DIRECTORY="/opt/postiz/uploads/"
    IS_GENERAL="true"
    # Add Social API and AI keys as needed
    
  4. Install Packages

    pnpm install
    
  5. Initialize Database Schema

    pnpm run prisma-db-push
    
  6. Launch Development Server

    pnpm run dev
    
  7. Access the local dashboard at http://localhost:4200.

Coolify Deployment

To deploy Postiz using Coolify:

  1. Create a new service named "Postiz" within your production environment.
  2. Use the following adapted Docker Compose configuration (ensure you update the URLs and JWT secret):
services:
  postiz:
    image: ghcr.io/gitroomhq/postiz-app:latest
    container_name: postiz
    restart: always
    environment:
      MAIN_URL: "https://postiz.your-server.com"
      FRONTEND_URL: "https://postiz.your-server.com"
      NEXT_PUBLIC_BACKEND_URL: "https://postiz.your-server.com/api"
      JWT_SECRET: "use-a-unique-random-string"
      DATABASE_URL: "postgresql://postiz-user:postiz-password@postiz-postgres:5432/postiz-db-local"
      REDIS_URL: "redis://postiz-redis:6379"
      BACKEND_INTERNAL_URL: "http://localhost:3000"
      IS_GENERAL: "true"
      STORAGE_PROVIDER: "local"
      UPLOAD_DIRECTORY: "/uploads"
      NEXT_PUBLIC_UPLOAD_DIRECTORY: "/uploads"
    volumes:
      - postiz-config:/config/
      - postiz-uploads:/uploads/
    ports:
      - 5000:5000
    networks:
      - postiz-network
    labels:
      - "traefik.enable=true"
      - "traefik.https.routers.postiz.rule=Host(`postiz.your-server.com`)"
      - "traefik.https.routers.postiz.entryPoints=https"
    depends_on:
      postiz-postgres:
        condition: service_healthy
      postiz-redis:
        condition: service_healthy

  postiz-postgres:
    image: postgres:14.5
    container_name: postiz-postgres
    restart: always
    environment:
      POSTGRES_PASSWORD: postiz-password
      POSTGRES_USER: postiz-user
      POSTGRES_DB: postiz-db-local
    volumes:
      - postgres-volume:/var/lib/postgresql/data
    networks:
      - postiz-network
    healthcheck:
      test: pg_isready -U postiz-user -d postiz-db-local
      interval: 10s
      timeout: 3s
      retries: 3

  postiz-redis:
    image: redis:7.2
    container_name: postiz-redis
    restart: always
    healthcheck:
      test: redis-cli ping
      interval: 10s
      timeout: 3s
      retries: 3
    volumes:
      - postiz-redis-data:/data
    networks:
      - postiz-network

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

networks:
  postiz-network:
  1. Save the configuration and navigate to the Service Stack tab.
  2. Select "Connect to Predefined Network" and verify that all three containers and associated volumes are correctly identified.

Deployment Note: The Postiz Docker image is large (approximately 2.5GB). The initial pull and extraction process may take several minutes due to the high file count. Once the logs indicate Container postiz-... Started, ensure the services are stable and not caught in a restart loop.

Postiz also maintains an affiliate program offering a 30% commission for referrals.