
Deploy MediaCMS | (Just Updated) Self-Hosted YouTube Alternative, Admin Login Pre-Created, Sign-up Closed
MediaCMS self-hosted video CMS, YouTube alternative with HLS
mediacms
Just deployed
/home/mediacms.io/mediacms/media_files
database
Just deployed
/var/lib/postgresql
redis
Just deployed
/data
Deploy and Host MediaCMS on Railway
Built for an LLM agent to deploy and use. The deploy form has no fields to fill: the admin password, the secret key, the database password and the Redis password are generated, the admin account exists before the site is reachable, and public sign-up is closed. MediaCMS is an open-source video and media CMS with uploads, transcoding to adaptive HLS, playlists, categories, comments and a REST API, a self-hosted alternative to YouTube and Vimeo.
About Hosting MediaCMS
This template runs three services: mediacms, the official MediaCMS image (release v9.6.1) pinned by digest in a thin wrapper, which owns the one public domain on port 8080 with an HTTP healthcheck at / and a volume at /home/mediacms.io/mediacms/media_files for uploads and encoded renditions; database, PostgreSQL 17 with a volume at /var/lib/postgresql; and redis, Redis 8 (celery broker and cache) with a volume at /data.
What the wrapper fixes. Stock MediaCMS needs four containers from one image (migrations, web, celery beat, celery worker) sharing volumes, which Railway cannot attach to more than one service, and it leaves public registration open. The wrapper keeps the image's own single-container mode (nginx, gunicorn, celery and migrations under supervisord), points nginx at Railway's injected port, caps celery's process count so it does not size itself from the host's cores, creates the admin account with the generated ADMIN_PASSWORD, and closes sign-up: the sign-up page says so and a POST to it answers 403. Redeploys keep the admin, the media and the database.
Using it. Open your domain and sign in as admin with ADMIN_PASSWORD. An agent uses the API instead: HTTP basic auth with the user name admin and ADMIN_PASSWORD against /api/v1. E-mail delivery is off. The first start migrates the database and takes about one minute; video encoding is CPU-bound and runs in the same container.
Agent contract
- Public URL:
https://RAILWAY_PUBLIC_DOMAIN(the generated domain of themediacmsservice) - Private URL:
http://mediacms.railway.internal:8080 - Credentials: the variable
ADMIN_PASSWORDon themediacmsservice (plain text; user nameadmin);ADMIN_EMAILis the admin e-mail address - Auth: the API takes HTTP basic auth with the user name
adminandADMIN_PASSWORD(curl -u "admin:$ADMIN_PASSWORD"); writes answer 403 without it - Health:
GET /returns 200 without credentials
#!/bin/sh
# needs: RAILWAY_PUBLIC_DOMAIN, ADMIN_PASSWORD (variables of the mediacms service); also curl.
R="https://$RAILWAY_PUBLIC_DOMAIN"; H="content-type: application/json"; J=$(mktemp)
n=0; until [ "$(curl -s -o /dev/null -w '%{http_code}' "$R/")" = 200 ]; do n=$((n+1)); [ "$n" -le 120 ] || break; sleep 5; done
curl -s -o /dev/null -w "health: %{http_code}\n" "$R/"
# sign-up is closed: a stranger who fetches a CSRF token from the login page and POSTs the sign-up form is refused
curl -s -c "$J" -o /dev/null "$R/accounts/login/"
TOKEN=$(awk '$6=="csrftoken"{print $7}' "$J")
curl -s -b "$J" -o /dev/null -w "public signup: %{http_code}\n" -H "Referer: $R/accounts/signup/" --data-urlencode "csrfmiddlewaretoken=$TOKEN" --data-urlencode "username=stranger" --data-urlencode "email=stranger@example.com" --data-urlencode "password1=Not-the-real-one-1" --data-urlencode "password2=Not-the-real-one-1" "$R/accounts/signup/"
# the generated password is the admin account (HTTP basic auth with the user name admin)
curl -s -u "admin:$ADMIN_PASSWORD" "$R/api/v1/whoami" | grep -o '"username":"[^"]*"' | head -1 | sed 's/^/whoami: /'
BODY="{\"title\":\"Agent $$\"}"
# write-auth: POST /api/v1/playlists needs the admin login; without it, or with a wrong password, the answer is 403
curl -s -o /dev/null -w "read with key: %{http_code}\n" -u "admin:$ADMIN_PASSWORD" "$R/api/v1/playlists"
curl -s -o /dev/null -w "write with key: %{http_code}\n" -H "$H" -u "admin:$ADMIN_PASSWORD" -d "$BODY" "$R/api/v1/playlists"
curl -s -o /dev/null -w "write without key: %{http_code}\n" -H "$H" -d "$BODY" "$R/api/v1/playlists"
curl -s -o /dev/null -w "write wrong key: %{http_code}\n" -H "$H" -u "admin:not-a-real-password" -d "$BODY" "$R/api/v1/playlists"
Expected output against a fresh deploy:
health: 200
public signup: 403
whoami: "username":"admin"
read with key: 200
write with key: 201
write without key: 403
write wrong key: 403
The refusals are the contract: a request without the password is refused (write without key: 403), a stranger cannot register (public signup: 403) and a wrong password is refused (write wrong key: 403).
Why Deploy MediaCMS 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 MediaCMS 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 app is healthy, strangers cannot register, the generated password is the admin and the API refuses writes without it.
- Admin included - the admin account has a generated password before the site is reachable, so nobody can claim your site by registering first.
- One container - web server, transcoding workers and migrations run together, no shared-volume juggling.
- Data survives redeploys - metadata in PostgreSQL on a volume, uploads and encodes on the media volume, the task queue on a Redis volume.
- Pinned - MediaCMS, PostgreSQL and Redis are pinned by digest or tag, and the wrapper by tag and digest.
Common Use Cases
- Self-hosted video platform - your own YouTube for a company, school or community, with HLS playback and categories.
- Internal training and media library - private or unlisted videos, playlists and comments for a team.
- Podcast and audio hosting - upload audio and video, share embeds.
- Media published by an AI agent - give an agent the admin login to create playlists and manage media through the API.
Dependencies for MediaCMS Hosting
- The mediacms service, a PostgreSQL service and a Redis service, each with its volume, created by the template.
Deployment Dependencies
Template Content