---
title: "Deploy Postmill"
description: "Self-hosted AI social media scheduler. Open-source Buffer alternative."
category: "Automation"
url: https://railway.com/deploy/postmill
---

# Deploy Postmill

Self-hosted AI social media scheduler. Open-source Buffer alternative.

**[Deploy Postmill on Railway](https://railway.com/template/postmill)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/postmill/manifest.json

- **Creator:** RBR Digital
- **Category:** Automation
- **Total deploys:** 2

## Template content

### Redis https://cdn.sanity.io/images/sy1jschh/production/0ce0bfdcfbdbf69662b1116671f97c2dd788b655-157x157.svg

- **Image:** redis:8.2
- **Start command:** `/bin/sh -c "rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH"`

### Postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:17

### Postmill https://postmill.ai/favicon.ico?favicon.3mrdgwep2povv.ico

- **Image:** ghcr.io/postmill-ai/postmill-app:latest
- **Public domain:** Yes

## Documentation

# Deploy and Host Postmill on Railway

[![Deploy on Railway](https://railway.com/button.svg)](https://railway.com/deploy/postmill?referralCode=9uHSFr&utm_medium=integration&utm_source=template&utm_campaign=generic)

Postmill is an open-source, self-hosted social media management platform. Schedule and publish posts across multiple social networks, generate content with AI, organize media, and collaborate with your team—all from a single dashboard, as an alternative to Buffer and Hootsuite where you own your data.

## About Hosting Postmill

Hosting Postmill requires a PostgreSQL database for persistence (users, workspaces, channels, posts, schedules), Redis for queues and caching, and a persistent volume for uploaded media. The all-in-one container bundles the frontend, backend API and background workers behind an internal nginx listening on port 5000. Database migrations run automatically as a pre-deploy step. Social channels and AI providers are configured inside the app, so no API keys are needed at deploy time. Railway provisions all services and handles networking, SSL, and scaling.

> **⚠️ Custom domain required:** Postmill's session cookie doesn't work on the default `*.up.railway.app` domain, so login will fail there. Add a custom domain (e.g. `postmill.yourdomain.com`) to the Postmill service before creating your account.

## Common Use Cases

- Scheduling and publishing posts across multiple social networks
- AI-assisted content creation and repurposing
- Social media management for agencies and multiple brands
- Team collaboration without per-seat SaaS pricing

## Dependencies for Postmill Hosting

- PostgreSQL 17 (persistence for users, channels, posts and schedules)
- Redis (queues and caching)
- Persistent volume (mount path: `/uploads` for uploaded media)

### Deployment Dependencies

- [Postmill GitHub](https://github.com/postmill-ai/postmill-app)
- [Railway Documentation](https://docs.railway.app)

### Implementation Details

**Environment variables** (use Railway reference syntax when deploying):

| Variable | Value |
|----------|-------|
| `MAIN_URL` | `https://${{RAILWAY_PUBLIC_DOMAIN}}` |
| `FRONTEND_URL` | `https://${{RAILWAY_PUBLIC_DOMAIN}}` |
| `NEXT_PUBLIC_BACKEND_URL` | `https://${{RAILWAY_PUBLIC_DOMAIN}}/api` |
| `BACKEND_INTERNAL_URL` | `http://localhost:3000` |
| `PORT` | `3000` |
| `JWT_SECRET` | `${{secret(64)}}` |
| `DATABASE_URL` | `${{Postgres.DATABASE_URL}}` |
| `REDIS_URL` | `${{Redis.REDIS_URL}}` |
| `UPLOAD_DIRECTORY` | `/uploads` |
| `DISABLE_REGISTRATION` | `false` |

**Volume:** Mount `/uploads` for persistent media.

**Networking:** Public domain targets port `5000` (nginx routes `/api` to the backend on `:3000` and everything else to the frontend on `:4200`). `PORT` must stay `3000`, since it's the backend's internal port.

**Pre-deploy command** (applies Prisma migrations):
```
/app/node_modules/.bin/prisma migrate deploy --schema /app/libraries/nestjs-libraries/src/database/prisma/schema.prisma
```

**After deploying:**
1. Add your custom domain to the Postmill service (target port `5000`). `RAILWAY_PUBLIC_DOMAIN` will pick it up after a redeploy.
2. Open `https://your-domain/auth/login`, create your account and sign in.
3. Set `DISABLE_REGISTRATION=true` to keep your instance private.

## Why Deploy Postmill on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Postmill on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.

---

## Template Author

Created and maintained by **Douglas Rubim**.

GitHub: https://github.com/douglasrubims

## Similar templates

- [N8N Main + Worker](https://railway.com/deploy/n8n-main-worker) — Deploy and Host N8N with Inactive worker.
- [Evolution API with n8n](https://railway.com/deploy/evolution-api-with-n8n) — Automate WhatsApp workflows with Evolution API, n8n, and Postgres.
- [Postgres Backup](https://railway.com/deploy/postgres-s3-backups) — Cron-based PostgreSQL backup to bucket storage

Open this page in a browser: https://railway.com/deploy/postmill
