Skip to main content

Environment Variables Reference

This page provides a comprehensive reference for all environment variables used in Postiz. Use this guide to configure your self-hosted instance.

Configuration File

You can configure Postiz using environment variables in:
  1. Docker Compose environment: section
  2. .env file (recommended for production)
  3. System environment variables
Download the example configuration:
curl -O https://raw.githubusercontent.com/gitroomhq/postiz-app/main/.env.example
cp .env.example .env

Required Settings

These variables are essential for Postiz to function:

Application URLs

MAIN_URL
string
required
The main URL where Postiz is accessible
MAIN_URL="http://localhost:4007"
# Production:
MAIN_URL="https://postiz.yourdomain.com"
FRONTEND_URL
string
required
The frontend application URL (usually same as MAIN_URL)
FRONTEND_URL="http://localhost:4007"
NEXT_PUBLIC_BACKEND_URL
string
required
The backend API URL accessible from the browser
NEXT_PUBLIC_BACKEND_URL="http://localhost:4007/api"
# Production:
NEXT_PUBLIC_BACKEND_URL="https://postiz.yourdomain.com/api"
BACKEND_INTERNAL_URL
string
required
Internal backend URL for server-side requests
BACKEND_INTERNAL_URL="http://localhost:3000"

Security

JWT_SECRET
string
required
Secret key for signing JWT tokens. MUST be unique and random!
JWT_SECRET="your-super-long-random-string-here"
Generate a secure random string:
openssl rand -base64 32
Never use the example value in production!

Database

DATABASE_URL
string
required
PostgreSQL connection string
DATABASE_URL="postgresql://postiz-user:postiz-password@localhost:5432/postiz-db-local"
Format: postgresql://[user]:[password]@[host]:[port]/[database]For Docker Compose:
DATABASE_URL="postgresql://postiz-user:postiz-password@postiz-postgres:5432/postiz-db-local"
REDIS_URL
string
required
Redis connection string
REDIS_URL="redis://localhost:6379"
For Docker Compose:
REDIS_URL="redis://postiz-redis:6379"

Temporal

TEMPORAL_ADDRESS
string
required
Temporal server address for workflow orchestration
TEMPORAL_ADDRESS="temporal:7233"

System Flags

IS_GENERAL
boolean
required
Required for current version. Always set to true.
IS_GENERAL="true"
DISABLE_REGISTRATION
boolean
default:"false"
Disable new user registration
DISABLE_REGISTRATION="false"
Set to "true" to disable public registration.

Storage Settings

Configure where media files are stored:
STORAGE_PROVIDER
string
default:"local"
Storage backend: local or cloudflare
STORAGE_PROVIDER="local"

Local Storage

UPLOAD_DIRECTORY
string
default:"/uploads"
Directory path for storing uploaded files (local storage only)
UPLOAD_DIRECTORY="/uploads"
NEXT_PUBLIC_UPLOAD_DIRECTORY
string
default:"/uploads"
Public URL path for accessing uploaded files
NEXT_PUBLIC_UPLOAD_DIRECTORY="/uploads"

Cloudflare R2 Storage

Cloudflare R2 is required for production deployments to save social media avatars and other assets.
CLOUDFLARE_ACCOUNT_ID
string
Your Cloudflare account ID
CLOUDFLARE_ACCOUNT_ID="your-account-id"
CLOUDFLARE_ACCESS_KEY
string
Cloudflare R2 access key
CLOUDFLARE_ACCESS_KEY="your-access-key"
CLOUDFLARE_SECRET_ACCESS_KEY
string
Cloudflare R2 secret access key
CLOUDFLARE_SECRET_ACCESS_KEY="your-secret-access-key"
CLOUDFLARE_BUCKETNAME
string
R2 bucket name
CLOUDFLARE_BUCKETNAME="postiz-uploads"
CLOUDFLARE_BUCKET_URL
string
Public URL for your R2 bucket
CLOUDFLARE_BUCKET_URL="https://your-bucket-url.r2.cloudflarestorage.com/"
CLOUDFLARE_REGION
string
default:"auto"
Cloudflare R2 region
CLOUDFLARE_REGION="auto"

Social Media OAuth

Configure OAuth credentials for each social media platform you want to support:

X (Twitter)

X_API_KEY
string
Twitter/X API key
X_API_KEY="your-x-api-key"
X_API_SECRET
string
Twitter/X API secret
X_API_SECRET="your-x-api-secret"

LinkedIn

LINKEDIN_CLIENT_ID
string
LinkedIn OAuth client ID
LINKEDIN_CLIENT_ID="your-linkedin-client-id"
LINKEDIN_CLIENT_SECRET
string
LinkedIn OAuth client secret
LINKEDIN_CLIENT_SECRET="your-linkedin-client-secret"

Reddit

REDDIT_CLIENT_ID
string
Reddit OAuth client ID
REDDIT_CLIENT_ID="your-reddit-client-id"
REDDIT_CLIENT_SECRET
string
Reddit OAuth client secret
REDDIT_CLIENT_SECRET="your-reddit-client-secret"

GitHub

GITHUB_CLIENT_ID
string
GitHub OAuth app client ID
GITHUB_CLIENT_ID="your-github-client-id"
GITHUB_CLIENT_SECRET
string
GitHub OAuth app client secret
GITHUB_CLIENT_SECRET="your-github-client-secret"

Facebook

FACEBOOK_APP_ID
string
Facebook App ID
FACEBOOK_APP_ID="your-facebook-app-id"
FACEBOOK_APP_SECRET
string
Facebook App Secret
FACEBOOK_APP_SECRET="your-facebook-app-secret"

Threads

THREADS_APP_ID
string
Meta Threads App ID
THREADS_APP_ID="your-threads-app-id"
THREADS_APP_SECRET
string
Meta Threads App Secret
THREADS_APP_SECRET="your-threads-app-secret"

YouTube

YOUTUBE_CLIENT_ID
string
Google OAuth client ID for YouTube
YOUTUBE_CLIENT_ID="your-youtube-client-id"
YOUTUBE_CLIENT_SECRET
string
Google OAuth client secret for YouTube
YOUTUBE_CLIENT_SECRET="your-youtube-client-secret"

TikTok

TIKTOK_CLIENT_ID
string
TikTok OAuth client ID
TIKTOK_CLIENT_ID="your-tiktok-client-id"
TIKTOK_CLIENT_SECRET
string
TikTok OAuth client secret
TIKTOK_CLIENT_SECRET="your-tiktok-client-secret"

Pinterest

PINTEREST_CLIENT_ID
string
Pinterest OAuth client ID
PINTEREST_CLIENT_ID="your-pinterest-client-id"
PINTEREST_CLIENT_SECRET
string
Pinterest OAuth client secret
PINTEREST_CLIENT_SECRET="your-pinterest-client-secret"

Dribbble

DRIBBBLE_CLIENT_ID
string
Dribbble OAuth client ID
DRIBBBLE_CLIENT_ID="your-dribbble-client-id"
DRIBBBLE_CLIENT_SECRET
string
Dribbble OAuth client secret
DRIBBBLE_CLIENT_SECRET="your-dribbble-client-secret"

Discord

DISCORD_CLIENT_ID
string
Discord OAuth client ID
DISCORD_CLIENT_ID="your-discord-client-id"
DISCORD_CLIENT_SECRET
string
Discord OAuth client secret
DISCORD_CLIENT_SECRET="your-discord-client-secret"
DISCORD_BOT_TOKEN_ID
string
Discord bot token for posting
DISCORD_BOT_TOKEN_ID="your-discord-bot-token"

Slack

SLACK_ID
string
Slack app client ID
SLACK_ID="your-slack-client-id"
SLACK_SECRET
string
Slack app client secret
SLACK_SECRET="your-slack-client-secret"
SLACK_SIGNING_SECRET
string
Slack signing secret for request verification
SLACK_SIGNING_SECRET="your-slack-signing-secret"

Mastodon

MASTODON_URL
string
default:"https://mastodon.social"
Mastodon instance URL
MASTODON_URL="https://mastodon.social"
MASTODON_CLIENT_ID
string
Mastodon OAuth client ID
MASTODON_CLIENT_ID="your-mastodon-client-id"
MASTODON_CLIENT_SECRET
string
Mastodon OAuth client secret
MASTODON_CLIENT_SECRET="your-mastodon-client-secret"

Beehiiv

BEEHIIVE_API_KEY
string
Beehiiv API key
BEEHIIVE_API_KEY="your-beehiiv-api-key"
BEEHIIVE_PUBLICATION_ID
string
Beehiiv publication ID
BEEHIIVE_PUBLICATION_ID="your-publication-id"

Listmonk

LISTMONK_DOMAIN
string
Listmonk instance domain
LISTMONK_DOMAIN="https://newsletter.yourdomain.com"
LISTMONK_USER
string
Listmonk username
LISTMONK_USER="your-listmonk-username"
LISTMONK_API_KEY
string
Listmonk API key
LISTMONK_API_KEY="your-listmonk-api-key"
LISTMONK_LIST_ID
string
Listmonk list ID for subscribers
LISTMONK_LIST_ID="your-list-id"

Generic OAuth Provider

Postiz supports generic OAuth 2.0 providers like Authentik, Keycloak, etc.
POSTIZ_GENERIC_OAUTH
boolean
default:"false"
Enable generic OAuth authentication
POSTIZ_GENERIC_OAUTH="false"
NEXT_PUBLIC_POSTIZ_OAUTH_DISPLAY_NAME
string
Display name for OAuth provider (shown on login button)
NEXT_PUBLIC_POSTIZ_OAUTH_DISPLAY_NAME="Authentik"
NEXT_PUBLIC_POSTIZ_OAUTH_LOGO_URL
string
Logo URL for OAuth provider
NEXT_PUBLIC_POSTIZ_OAUTH_LOGO_URL="https://raw.githubusercontent.com/walkxcode/dashboard-icons/master/png/authentik.png"
POSTIZ_OAUTH_URL
string
Base URL of your OAuth provider
POSTIZ_OAUTH_URL="https://auth.example.com"
POSTIZ_OAUTH_AUTH_URL
string
OAuth authorization endpoint
POSTIZ_OAUTH_AUTH_URL="https://auth.example.com/application/o/authorize"
POSTIZ_OAUTH_TOKEN_URL
string
OAuth token endpoint
POSTIZ_OAUTH_TOKEN_URL="https://auth.example.com/application/o/token"
POSTIZ_OAUTH_USERINFO_URL
string
OAuth userinfo endpoint
POSTIZ_OAUTH_USERINFO_URL="https://auth.example.com/application/o/userinfo"
POSTIZ_OAUTH_CLIENT_ID
string
OAuth client ID
POSTIZ_OAUTH_CLIENT_ID="your-oauth-client-id"
POSTIZ_OAUTH_CLIENT_SECRET
string
OAuth client secret
POSTIZ_OAUTH_CLIENT_SECRET="your-oauth-client-secret"
POSTIZ_OAUTH_SCOPE
string
default:"openid profile email"
OAuth scopes to request
POSTIZ_OAUTH_SCOPE="openid profile email"

Email Settings

RESEND_API_KEY
string
Resend API key for sending emails
RESEND_API_KEY="re_yourApiKey"
If this variable is set, user activation emails are required. If commented out, users are activated automatically.
EMAIL_FROM_ADDRESS
string
Email sender address
EMAIL_FROM_ADDRESS="[email protected]"
EMAIL_FROM_NAME
string
Email sender name
EMAIL_FROM_NAME="Postiz"

AI Features

OPENAI_API_KEY
string
OpenAI API key for AI-powered features
OPENAI_API_KEY="sk-your-openai-api-key"
Postiz supports multiple URL shortening services:

Dub

DUB_TOKEN
string
Dub API token
DUB_TOKEN="your-dub-token"
DUB_API_ENDPOINT
string
default:"https://api.dub.co"
Dub API endpoint
DUB_API_ENDPOINT="https://api.dub.co"
Dub short link domain
DUB_SHORT_LINK_DOMAIN="dub.sh"

Short.io

SHORT_IO_SECRET_KEY
string
Short.io API secret key
SHORT_IO_SECRET_KEY="your-short-io-key"

Kutt

KUTT_API_KEY
string
Kutt.it API key
KUTT_API_KEY="your-kutt-api-key"
KUTT_API_ENDPOINT
string
default:"https://kutt.it/api/v2"
Kutt API endpoint
KUTT_API_ENDPOINT="https://kutt.it/api/v2"
Kutt short link domain
KUTT_SHORT_LINK_DOMAIN="kutt.it"

LinkDrip

LinkDrip API key
LINK_DRIP_API_KEY="your-linkdrip-api-key"
LinkDrip API endpoint
LINK_DRIP_API_ENDPOINT="https://api.linkdrip.com/v1/"
LinkDrip short link domain
LINK_DRIP_SHORT_LINK_DOMAIN="dripl.ink"

Payment Settings

FEE_AMOUNT
number
default:"0.05"
Fee percentage for transactions (0.05 = 5%)
FEE_AMOUNT=0.05
STRIPE_PUBLISHABLE_KEY
string
Stripe publishable key
STRIPE_PUBLISHABLE_KEY="pk_live_your_key"
STRIPE_SECRET_KEY
string
Stripe secret key
STRIPE_SECRET_KEY="sk_live_your_key"
STRIPE_SIGNING_KEY
string
Stripe webhook signing secret
STRIPE_SIGNING_KEY="whsec_your_key"
STRIPE_SIGNING_KEY_CONNECT
string
Stripe Connect webhook signing secret
STRIPE_SIGNING_KEY_CONNECT="whsec_your_connect_key"

Monitoring and Debugging

Sentry

NEXT_PUBLIC_SENTRY_DSN
string
Sentry DSN for error tracking
NEXT_PUBLIC_SENTRY_DSN="http://spotlight:8969/stream"
SENTRY_SPOTLIGHT
boolean
Enable Sentry Spotlight for local development
SENTRY_SPOTLIGHT="1"

Miscellaneous

API_LIMIT
number
default:"30"
Rate limit for public API (requests per hour)
API_LIMIT=30
NEXT_PUBLIC_DISCORD_SUPPORT
string
Discord support server invite link
NEXT_PUBLIC_DISCORD_SUPPORT="https://discord.gg/your-invite"
NEXT_PUBLIC_POLOTNO
string
Polotno API key for image editing features
NEXT_PUBLIC_POLOTNO="your-polotno-key"
EXTENSION_ID
string
Chrome extension ID for cookie-based platform integrations
EXTENSION_ID="your-extension-id"
NOT_SECURED
boolean
default:"false"
Disable security features (development only)
NOT_SECURED=false
Never set to true in production!

Developer Settings

NX_ADD_PLUGINS
boolean
default:"false"
Enable NX plugins (monorepo development)
NX_ADD_PLUGINS=false

Example Configuration

Here’s a minimal production-ready configuration:
.env
# Required Settings
MAIN_URL="https://postiz.yourdomain.com"
FRONTEND_URL="https://postiz.yourdomain.com"
NEXT_PUBLIC_BACKEND_URL="https://postiz.yourdomain.com/api"
BACKEND_INTERNAL_URL="http://localhost:3000"

# Security
JWT_SECRET="your-super-long-random-secret-here"

# Database
DATABASE_URL="postgresql://postiz:secure_password@postiz-postgres:5432/postiz"
REDIS_URL="redis://postiz-redis:6379"

# Temporal
TEMPORAL_ADDRESS="temporal:7233"

# System
IS_GENERAL="true"
DISABLE_REGISTRATION="false"

# Storage
STORAGE_PROVIDER="cloudflare"
CLOUDFLARE_ACCOUNT_ID="your-account-id"
CLOUDFLARE_ACCESS_KEY="your-access-key"
CLOUDFLARE_SECRET_ACCESS_KEY="your-secret"
CLOUDFLARE_BUCKETNAME="postiz-uploads"
CLOUDFLARE_BUCKET_URL="https://uploads.yourdomain.com/"
CLOUDFLARE_REGION="auto"

# Social Media (add as needed)
X_API_KEY="your-x-api-key"
X_API_SECRET="your-x-api-secret"
LINKEDIN_CLIENT_ID="your-linkedin-id"
LINKEDIN_CLIENT_SECRET="your-linkedin-secret"

# Optional Features
OPENAI_API_KEY="sk-your-openai-key"
RESEND_API_KEY="re_your-resend-key"
EMAIL_FROM_ADDRESS="[email protected]"

Security Best Practices

  1. Never commit .env files to version control
  2. Use strong random values for JWT_SECRET
  3. Change default database passwords in production
  4. Enable HTTPS for all production deployments
  5. Restrict database access to localhost or private networks
  6. Regularly rotate secrets and API keys

Next Steps

1

Configure Storage

Set up storage configuration for your deployment
2

Add OAuth Providers

Configure authentication for social platforms
3

Set Up Database

Build docs developers (and LLMs) love