If you’re looking for more control over your social media management, self-hosting a tool like Postiz can be a great option. Postiz is an all-in-one social media management tool that allows you to manage your social media strategy on your terms. It gives you the flexibility to customize everything while keeping your data secure and private.
In this guide, we’ll walk you through the process of setting up Postiz on your own server using Docker. We’ll cover everything you need to get started, from prerequisites to the final installation steps, making sure you’re all set to start managing your social media in no time.
Postiz Docker Installation Guide
Postiz Docker Installation Guide
A virtual machine (Linux server, Ubuntu 24.04 recommended)
Docker and Docker Compose installed (Review our article on How to Install Docker)
A Reverse Proxy (like Nginx or Caddy) if you plan to use HTTPS
Sufficient resources for smooth running (at least 4GB RAM, 2 vCPUs)
HTTPS / HTTP: Postiz uses secure cookies (marked as Secure), requiring a secure context (HTTPS). To enable HTTPS, set up a reverse proxy like Nginx or Caddy with SSL certificates. Review our article on How to Set Up a Reverse Proxy. If you are unable to use HTTPS in your environment, set the environment variable NOT_SECURED=true in an environment file (we’ll preview later) or directly in docker-compose.yml, though not recommended for production.
Ports
Expose only the necessary ports to your reverse proxy to reduce misconfiguration risks:
- 5000/TCP – Entry point for Postiz (used by reverse proxy)
- 5432/TCP – Postgres database (internal use)
- 6379/TCP – Redis (internal use)
- Optional: 4200/TCP – Frontend web interface (not usually exposed publicly)
- Optional: 3000/TCP – Backend API (not usually exposed publicly)
Step-by-Step Installation
First, clone the Postiz repository and create the setup directory:
git clone https://github.com/your-repo/postiz.git
cd postiz
mkdir docker-setup
cd docker-setup
Create a docker-compose.yml File
nano docker-compose.yml
Save the following content into it:
services:
postiz:
image: ghcr.io/gitroomhq/postiz-app:latest
container_name: postiz
restart: always
environment:
MAIN_URL: "https://yourdomain.com.com" # Replace with your server's URL
FRONTEND_URL: "https://yourdomain.com.com"
NEXT_PUBLIC_BACKEND_URL: "https://yourdomain.com/api"
JWT_SECRET: "yourUniqueRandomSecret" # Generate a secure secret
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"
DISABLE_REGISTRATION: "false"
STORAGE_PROVIDER: "local"
UPLOAD_DIRECTORY: "/uploads"
NEXT_PUBLIC_UPLOAD_DIRECTORY: "/uploads"
# To disable HTTPS (not recommended), remove # from line below:
# NOT_SECURED: "true"
volumes:
- postiz-config:/config/
- postiz-uploads:/uploads/
ports:
- 5000:5000 # Expose only port 5000 for reverse proxy
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
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postiz-user -d postiz-db-local"]
interval: 10s
timeout: 3s
retries: 3
networks:
- postiz-network
postiz-redis:
image: redis:7.2
container_name: postiz-redis
restart: always
healthcheck:
test: ["CMD", "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:
Note: Replace “https://yourdomain.com” and “yourUniqueRandomSecret” with your actual domain and a securely generated secret (e.g., using the command “openssl rand -base64 32”).
Optional: Use a .env File for Environment Variables
Alternatively, you can create a .env file to manage environment variables separately, which docker-compose can automatically load. To do this, create a .env file:
nano .env
Then add variables into it:
# To disable HTTPS (not recommended), remove # from line below:
# NOT_SECURED=true
MAIN_URL=https://yourdomain.com
FRONTEND_URL=https://yourdomain.com
NEXT_PUBLIC_BACKEND_URL=https://yourdomain.com/api
JWT_SECRET=yourUniqueRandomSecret
DATABASE_URL=postgresql://postiz-user:postiz-password@postiz-postgres:5432/postiz-db-local
REDIS_URL=redis://postiz-redis:6379
Then you’ll adjust docker-compose.yml to use these variables, replace the environment section with variable references. Edit the file with “nano docker-compose.yml” then update values as such:
MAIN_URL: "${MAIN_URL}"
FRONTEND_URL: "${FRONTEND_URL}"
NEXT_PUBLIC_BACKEND_URL: "${NEXT_PUBLIC_BACKEND_URL}"
JWT_SECRET: "${JWT_SECRET}"
DATABASE_URL: "${DATABASE_URL}"
REDIS_URL: "${REDIS_URL}"
Launch the Containers
Run the following command to start everything:
docker compose up -d
If you modify the docker-compose.yml or .env, run:
docker compose down
docker compose up -d
Set Up HTTPS / Reverse Proxy For HTTPS:
Configure a reverse proxy like Nginx or Caddy to forward traffic from port 443 to your container’s port 5000 making sure your SSL certificates are correctly set up. If you need to set up a reverse proxy, review our article on How to Set up a Reverse Proxy. While not recommended, you can disable HTTPS by setting NOT_SECURED=true in your .env or environment variables.
Access Postiz
Once containers are running and configured, visit your website URL in a browser:
https://yourwebsite.com
And you should be able to access the web interface.
Now you’re all set to start managing your social media with confidence and peace of mind.
Troubleshooting:
If you bump into any errors, first place to check is container logs for errors:
docker logs -f postiz
Postiz is the go-to choice for developers and businesses that want complete control over their data and a self-hosted solution. Getting up and running on your own server gives you the freedom and control to manage your social media data exactly how you want. It might take a bit of effort to set everything up—configuring your reverse proxy, securing your connection with SSL, and making sure all the pieces work together—but once it’s done, you’ll have a powerful, private platform that you maintain.
Leave a Reply