Deploy TryPost | (Just Updated) Social Media Scheduler, Buffer Alternative With Admin Login And API Key Generated
TryPost self-hosted social media scheduler, post to X, LinkedIn, Instagram
database
Just deployed
/var/lib/postgresql
cache
Just deployed
/data
trypost
Just deployed
/var/www/html/storage
Deploy and Host TryPost on Railway
Built for an LLM agent to deploy and use. The deploy form has no fields to fill: the administrator login, an API key, the application key and the database and Redis passwords are generated, the server cannot start without them, and registration is closed so nobody can sign up on a fresh instance. TryPost is the open-source social media scheduler: plan and publish posts to X, LinkedIn, Instagram, Facebook, TikTok, YouTube and more from one calendar, with a REST API and an MCP endpoint.
About Hosting TryPost
This template runs three services: trypost, the official ghcr.io/trypostit/trypost image (2.1.0) pinned by digest through a thin wrapper, with a volume at /var/www/html/storage that holds uploaded media, the Passport signing keys, logs and the generated API key; database, a PostgreSQL 16 instance with a volume at /var/lib/postgresql that holds workspaces, posts and users; and cache, a Redis 8 instance with a volume at /data that holds the job queue and cache. One public domain serves the web app, the API and the websocket. The stock image runs nginx, PHP-FPM, Laravel Horizon (the queue workers), the scheduler that publishes due posts and the Reverb websocket server in one container; the wrapper moves nginx onto the injected PORT (8080) and forwards the websocket through the same domain. The healthcheck is GET /up. A cold first boot runs the database migrations, so allow a few minutes before the first request answers.
What the wrapper fixes. The stock image expects you to run an installer, create the first user in the browser and issue an API key by hand, and its websocket client is compiled against localhost:8080. The wrapper creates the owner from ADMIN_EMAIL and ADMIN_PASSWORD before the web server starts, issues an API key for that owner and serves it only behind the admin login, derives a stable APP_KEY from a generated secret so sessions and encrypted columns survive redeploys, generates the Passport key pair once on the volume, points the browser's websocket client at your domain over TLS, and retries migrations while the database starts. It refuses to start without a login password of at least 16 characters and database and Redis credentials. Not reproduced on a Railway control of an incumbent listing.
Using it. Open the domain and sign in as ADMIN_EMAIL with ADMIN_PASSWORD, then connect your social accounts in the workspace settings. Connecting a network needs that network's developer app: add its client id and secret as variables on the trypost service (see the TryPost docs for the variable names per network). Outgoing email is not configured (MAIL_MAILER=log): add the MAIL_* variables to send invitations and notifications. Everything is stored in PostgreSQL, Redis and the storage volume, so redeploys keep it.
Agent contract
- Public URL:
https://RAILWAY_PUBLIC_DOMAIN(the generated domain of thetrypostservice) - Private URL:
http://trypost.railway.internal:8080 - Credentials: the variables
ADMIN_EMAILandADMIN_PASSWORDon thetrypostservice (plain text;ADMIN_EMAILisadmin@plus the public domain). The API key is not a variable: it is served at/bootstrap/api-keybehind HTTP basic auth with those two values - Auth: send
Authorization: Bearer $KEY (the key from/bootstrap/api-key)on every call under/api/; the web login at/loginusesADMIN_EMAILandADMIN_PASSWORD - Health:
GET /upreturns 200 without credentials
#!/bin/sh
# needs: RAILWAY_PUBLIC_DOMAIN, ADMIN_EMAIL, ADMIN_PASSWORD (variables of the trypost service); also curl, sed.
R="https://$RAILWAY_PUBLIC_DOMAIN"; J="content-type: application/json"; A="accept: application/json"; JAR=$(mktemp)
n=0; until [ "$(curl -s -o /dev/null -w '%{http_code}' "$R/up")" = 200 ]; do n=$((n+1)); [ "$n" -le 60 ] || break; sleep 5; done
curl -s -o /dev/null -w "health: %{http_code}\n" "$R/up"
# the API key made at first boot is served only behind the generated admin login (HTTP basic auth)
curl -s -o /dev/null -w "key without login: %{http_code}\n" "$R/bootstrap/api-key"
KEY=$(curl -s -u "$ADMIN_EMAIL:$ADMIN_PASSWORD" "$R/bootstrap/api-key")
# the key is a Bearer token: a read with it succeeds, the same read without it is refused
curl -s -o /dev/null -w "read with key: %{http_code}\n" -H "$A" -H "Authorization: Bearer $KEY" "$R/api/workspace"
curl -s -o /dev/null -w "read without key: %{http_code}\n" -H "$A" "$R/api/workspace"
# write-auth: a write (create a label) with the key succeeds, the same write without it is refused
curl -s -o /dev/null -w "write with key: %{http_code}\n" -H "$A" -H "$J" -H "Authorization: Bearer $KEY" -d '{"name":"agent-check","color":"#3366ff"}' "$R/api/labels"
curl -s -o /dev/null -w "write without key: %{http_code}\n" -H "$A" -H "$J" -d '{"name":"anon","color":"#ff0000"}' "$R/api/labels"
# public signup: a stranger's registration (with a valid CSRF token) is refused, registration is closed to everyone but invites
curl -s -o /dev/null -c "$JAR" "$R/login"
XSRF=$(sed -n 's/.*XSRF-TOKEN\t//p' "$JAR" | sed 's/%3D/=/g; s/%2B/+/g; s/%2F/\//g')
curl -s -o /dev/null -b "$JAR" -w "public signup: %{http_code}\n" -H "$A" -H "X-XSRF-TOKEN: $XSRF" -H "Origin: $R" -H "Referer: $R/register" --data-urlencode "name=Stranger" --data-urlencode "email=stranger@example.org" --data-urlencode "password=Stranger-Pass-Abcdef1" --data-urlencode "password_confirmation=Stranger-Pass-Abcdef1" "$R/register"
Expected output against a fresh deploy (measured on a Railway control deploy; the output is recorded in template.md):
health: 200
key without login: 401
read with key: 200
read without key: 401
write with key: 201
write without key: 401
public signup: 404
The refusals are the contract: the API key is not served without the admin login, a read or write without the key answers 401 (write without key: 401), and an anonymous registration answers 404 (public signup: 404) because the route is not registered.
Why Deploy TryPost 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 TryPost 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.
- Agent-ready - no deployer fields, a contract block, and one script that proves the server is healthy, a stranger is refused, and the generated API key can read and write.
- No setup wizard - the owner account and API key exist before the first request, and registration is closed.
- Data survives redeploys - posts and workspaces in PostgreSQL on a volume, the queue in Redis on a volume, media and signing keys on a volume.
- Real-time works - the websocket is served through the same public domain over TLS.
- Pinned - the upstream image is pinned by digest and the wrapper by tag and digest.
Common Use Cases
- Self-hosted social media scheduling - plan posts for several networks from one calendar and keep your accounts and drafts on your own server.
- Agency client calendars - separate workspaces per brand with approvals and a shared content calendar.
- Automated posting from your own tools - create and schedule posts from scripts and AI agents through the REST API.
Dependencies for TryPost Hosting
- The trypost service, a PostgreSQL service and a Redis service, each with its volume, created by the template.
Deployment Dependencies
Template Content
