To self-host MediaCMS on a managed VPS is to publish your videos, audio, images and PDFs on a portal of your own, on a server that our teams keep up to date and monitor day and night. MediaCMS is a free, open source video and media CMS under the AGPL-3.0 license, used by universities, organizations and communities. This guide follows its official Docker Compose setup at version 9.6.1, and we ran every command on a Simafri VPS before writing it: installation with PostgreSQL, Redis and Celery, HTTPS, portal settings, video encoding, backups and updates.
By Simon Vasconcelos Lee
Published on 1 December 202614 minute read
/opt/mediacms and its docker-compose.yaml, with a docker-compose.override.yaml of your own for the port, the passwords and the database volume.127.0.0.1 only, put Caddy in front for HTTPS, and set FRONTEND_HOST to your https:// address.CELERYD_CONCURRENCY to deploy/docker/local_settings.py, set to your number of vCPUs: on our 4 GB test VPS, the 1080p encoding ran out of memory without it, and succeeded with it.pg_dump and an archive of media_files, and update the Git checkout and the image together.MediaCMS is a video and media portal written in Python with Django, with a React interface and a REST API. You upload a file, and its Celery workers encode it in several resolutions, build an HLS stream for adaptive playback and produce the thumbnails and preview images.
full image, and migration tools from YouTube, Kaltura and Panopto.MediaCMS is published under the GNU Affero General Public License, version 3, copyright Markos Gogoulos. You can use it free of charge, for your organization or your clients, copy it and modify it. If you modify it and let people use it over a network, as a public portal does, you offer them the source code of your modified version under the same license. The software is provided without warranty.
The team behind MediaCMS also offers custom installations, development, migrations, training and support, on its services page.
The README counts 4 GB of memory and 2 to 4 CPUs as a minimum for a small to medium portal, with a few hours of video uploaded each day and a few hundred daily viewers. Our test VPS had exactly that, 2 vCPUs and 4 GB, and here is what we measured:
celery_worker container (1.8 GB), which runs two pools of ten processes for short tasks and the encoding pool. The web container used about 275 MB, PostgreSQL and Redis less than 50 MB together.CELERYD_CONCURRENCY = 2, explained below. Without it, the same clip pushed the server to 3.95 GB and the 1080p encoding was killed for lack of memory.latest image is built for x86-64.full image, about 3.6 GB compressed, and the README advises more CPUs.With 2 vCPUs and 4 GB, MediaCMS works, with little headroom during an encoding. For several uploads at a time, longer 1080p videos or transcription, plan more memory and more vCPUs. On a managed VPS, tell us about your usage and we will recommend the right size.
The administrators documentation installs MediaCMS from a Git checkout: its docker-compose.yaml mounts the whole folder into the containers, so the code that runs is the code of the checkout, and the mediacms/mediacms image brings Python, ffmpeg and Bento4. On a server with Docker Engine and its Compose plugin, installed from Docker’s repository for Ubuntu, and Git, clone the repository into /opt/mediacms and check out the release:
git clone https://github.com/mediacms-io/mediacms /opt/mediacms
git checkout v9.6.1
The official file publishes port 80 on every address of the server, uses mediacms as the database password and keeps the database in ../postgres_data, outside the folder. Rather than edit it, put your changes in a docker-compose.override.yaml next to it, which Docker Compose reads and merges on its own:
# Changes to the official docker-compose.yaml, which Docker Compose merges on its own
x-env: &env
FRONTEND_HOST: https://mediacms.example.com
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD in .env}
services:
migrations:
environment:
<<: *env
ADMIN_EMAIL: admin@mediacms.example.com
ADMIN_PASSWORD: ${ADMIN_PASSWORD:?set ADMIN_PASSWORD in .env}
web:
restart: unless-stopped
ports: !override
- "127.0.0.1:8113:80"
environment: *env
celery_beat:
restart: unless-stopped
environment: *env
celery_worker:
restart: unless-stopped
environment: *env
db:
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD in .env}
volumes: !override
- postgres_data:/var/lib/postgresql/data/
volumes:
postgres_data:
The two passwords go in a .env file, which Docker Compose also reads. Create it readable by root only, then start the stack:
umask 077
printf 'POSTGRES_PASSWORD=%s\nADMIN_PASSWORD=%s\n' "$(openssl rand -hex 24)" "$(openssl rand -hex 12)" > .env
umask 022
docker compose up -d
docker compose ps -a
migrations prepares the database and stops, web serves the portal with nginx and Gunicorn, celery_worker encodes and runs the short tasks, celery_beat schedules the periodic ones, with db, PostgreSQL 17.2, and redis.127.0.0.1: !override replaces the port list of the official file instead of adding to it, so MediaCMS is reachable only through the reverse proxy. Any free port will do.FRONTEND_HOST is your public address, with https://: MediaCMS builds its links and emails from it. The Docker settings file reads it, like the database password, from the environment.ADMIN_PASSWORD, the first start creates admin with a random password shown in the log of migrations. That log shows the password you set too, so keep it to root, like .env.postgres_data, rather than a folder next to the code: the start script of the image gives every file of /opt/mediacms to www-data, the user of MediaCMS in the containers, and PostgreSQL wants its own.restart: unless-stopped: the official file sets no restart policy on web, celery_worker and celery_beat. With it, all three came back on their own when we restarted Docker on our test VPS.latest image: version tags on Docker Hub stop at 7.2.0, and latest is built from the main branch, where the releases are made. On the day we tested, it was built from the code of 9.6.1. The code that runs comes from your checkout.The first start applies 75 migrations, loads the encoding profiles and the default categories, creates the administrator and collects the static files; on our test VPS, the migrations container finished less than a minute after docker compose up -d, images included. When it shows “Exited (0)”, check that the portal answers:
curl -s http://127.0.0.1:8113/ | grep -o '<title>[^<]*</title>'
It returns <title>MediaCMS</title>, the name of the portal.
The web container serves MediaCMS over HTTP, on port 8113 of the server. HTTPS is handled by a reverse proxy in front of it, which must forward X-Forwarded-Proto. We tested Caddy, installed from its official Debian and Ubuntu repository: it obtains the Let’s Encrypt certificate itself, renews it, and forwards that header by default.
mediacms.example.com {
reverse_proxy 127.0.0.1:8113
}
systemctl reload caddy
curl -sI https://mediacms.example.com/
HTTP/2 200 a few seconds later.X-Forwarded-Proto on to Gunicorn, which trusts it from 127.0.0.1, so Django knows the visit is in HTTPS. We checked it with a login from an https:// origin: accepted, with a redirect to the home page.Open your address and click Sign in. The username is admin, and the password is the one generated in .env, which this command displays:
grep ADMIN_PASSWORD /opt/mediacms/.env
Out of the box, anyone can create an account and upload media: USERS_CAN_SELF_REGISTER is on and CAN_ADD_MEDIA is set to all. On a portal open to the internet, decide who may register and upload before you share the address.
The settings of MediaCMS live in cms/settings.py, and the documentation has you override them in deploy/docker/local_settings.py, which the image copies into place at every start. Add these lines at the end of it, then restart the three MediaCMS services:
cat >> deploy/docker/local_settings.py <<'EOF'
# Our settings, after the official ones
USERS_CAN_SELF_REGISTER = False
REGISTER_ALLOWED = False
CAN_ADD_MEDIA = "advancedUser"
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
CELERYD_CONCURRENCY = 2
EOF
docker compose restart web celery_worker celery_beat
USERS_CAN_SELF_REGISTER and REGISTER_ALLOWED at False close the sign-up page and hide its button. On our VPS, the sign-up address then showed “Sign Up Closed”. You create the accounts yourself, from the Django administration at /admin/.advancedUser, only the users you mark as advanced users in their profile can add media. The documentation lists two other values, all and email_verified.settings.py, commented out. On our VPS, the session cookie was then marked Secure.CELERYD_CONCURRENCY sets the size of the encoding pool. Without it, Celery takes the number of processors Python counts, and on our test VPS, inside the container, Python counted the 16 processors of the underlying machine rather than the 2 vCPUs of the VPS: 16 encoding processes started, enough to encode every resolution at the same time, and the 1080p encoding was killed for lack of memory. With the setting, two ran at a time. Set it to your number of vCPUs, which nproc shows.EMAIL_USE_TLS = True. On a Simafri VPS, applications send through an authenticated SMTP relay on port 587. We did not send email from our test VPS.PORTAL_WORKFLOW makes new media public, private or unlisted, and section 5 of the documentation lists the rest, from the portal name to the upload size limit.We then uploaded our 15-second 1080p test clip. MediaCMS marked it ready as soon as its first resolution was encoded, the other five and the HLS stream followed within 28 seconds, and the 1080p file was served over HTTPS as video/mp4.
Everything lives in two places: the PostgreSQL database, with the users, the media records and the settings made in the administration, and the /opt/mediacms folder, with media_files (the originals, the encoded versions, HLS and the thumbnails), the .secret_key file that signs sessions, your .env, your override file and your local_settings.py. The PostgreSQL image includes pg_dump:
umask 077
mkdir -p backups
docker compose exec -T db pg_dump -U mediacms -Fc mediacms > backups/mediacms-$(date +%F).dump
tar -czf backups/files-$(date +%F).tar.gz media_files .secret_key .env docker-compose.override.yaml deploy/docker/local_settings.py
umask 022
Under umask 077, both files are readable by root only. The backups folder is inside the folder mounted into the containers, whose start script gives every file to www-data, the user that already holds the database password: schedule this copy and send it off the server. Stored on the disk, the files are also included in the server’s nightly backups.
On the same installation, or on a new one with the same checkout, override file and .env where only docker compose up -d db redis has run, stop the application, recreate the database, load the dump and the files, then start it again:
docker compose stop web celery_worker celery_beat &&
docker compose exec -T db dropdb -U mediacms mediacms &&
docker compose exec -T db createdb -U mediacms mediacms &&
docker compose exec -T db pg_restore -U mediacms -d mediacms --exit-on-error --no-owner < backups/mediacms-2026-11-20.dump &&
rm -rf media_files && tar -xzf backups/files-2026-11-20.tar.gz &&
docker compose up -d
--exit-on-error stops the restore at the first error, and the && stop the sequence there: the files stay as they are and MediaCMS stays stopped.media_files and .secret_key removed, then the restore. Both test videos came back with their 13 encodings, the 1080p version was served again over HTTPS, and the administrator’s password worked at once.MediaCMS publishes its releases on GitHub, often several a month, and the latest image follows. Since the code comes from your checkout, an update moves the checkout to the new release tag and pulls the image, together. Take a backup first.
Git refuses to work in the folder once the containers have given its files to www-data (“detected dubious ownership”). Allow it once:
git config --global --add safe.directory /opt/mediacms
Then fetch the tags, check out the new release, here v9.6.1, and pull the images. --merge carries the lines you added to local_settings.py over to the new version:
git fetch --tags
git checkout --merge v9.6.1
docker compose pull
docker compose up -d
git describe --tags
git diff --stat
migrations applied 10 migrations and left the existing data as it was, the video uploaded in 7.2.0 was still served in 1080p, and the 8 lines we had added to local_settings.py were still there. Version 7.2.0 had no .secret_key file, its key being a fixed value of the settings: 9.6.1 generated one at its first start.migrations once more, the other containers left running; git diff --stat then lists the lines you added.local_settings.py, the release changed the lines next to yours: Git marks both versions in the file; keep what you need, then run docker compose up -d.postgres:17.2-alpine. A new major version does not read the old data folder: the documentation explains the move, with a dump and a restore.Self-hosting means running the server on top of the application. On a managed VPS, our teams take charge of the server and proactively monitor your instance; MediaCMS remains your software, with your media and your settings.
| Topic | Our teams | You |
|---|---|---|
| The server | System and security updates, server interventions included | The timing that suits you |
| Monitoring | Server monitored 24/7, with intervention without waiting for your call | Your media, your users and your settings in MediaCMS |
| MediaCMS | Proactive monitoring: errors, slowdowns, memory during encodings, database and disk space spotted, fix recommended | Its installation, updates and settings, which you apply, yourself or through your AI assistant |
| Users | The server that carries them, monitored and backed up | Accounts, roles and who may upload |
| Backups | Every night, encrypted and kept off the machine; restores included | MediaCMS’s own database dumps and media archives, and the restore request, when you need one |
| Migration | Your current server migrated, free of charge | The timing of the switch |
If you would rather have our teams work inside the application itself, that service is billed by the hour or at a fixed rate, with an estimate shared before the work starts.
With a Simafri Managed VPS, our teams keep your MediaCMS instance’s server up to date, monitor it day and night and step in without waiting for your call; they also proactively monitor your instance and recommend useful fixes, which you apply, yourself or through your AI assistant. Backups are encrypted every night and kept off the machine, restores are included, and migrating your current server is free.
Yes. MediaCMS is under the AGPL-3.0 license: you can run it for your organization, your school or your community with no license to buy. If you modify its code and offer it over a network, you share your changes under the same license. What remains is the cost of the server that runs it.
Clone the repository into /opt/mediacms, check out the release tag, and add a docker-compose.override.yaml that publishes the port on 127.0.0.1, sets FRONTEND_HOST to your https address, takes the database and admin passwords from a .env file and keeps PostgreSQL in a named volume. Run docker compose up -d, then put an HTTPS reverse proxy in front.
The README counts 4 GB of memory and 2 to 4 CPUs as a minimum for a small to medium portal, and three times the size of your uploads in disk space. On our test VPS with 2 vCPUs and 4 GB, MediaCMS used about 2.4 GB at rest and 3.3 GB at the peak of a 1080p encoding, with CELERYD_CONCURRENCY set to 2.
Often for lack of memory. Celery sizes its encoding pool from the number of processors Python counts, which can be the processors of the host rather than those of your VPS. On our 4 GB test VPS, the 1080p encoding was killed until we added CELERYD_CONCURRENCY = 2 to deploy/docker/local_settings.py and restarted the containers.
The first start creates the user admin. Without ADMIN_PASSWORD, its password is random and shown in the log of the migrations container; with ADMIN_PASSWORD in your .env, it is the one you set.
Add USERS_CAN_SELF_REGISTER = False and REGISTER_ALLOWED = False to deploy/docker/local_settings.py, and CAN_ADD_MEDIA = "advancedUser" to choose who uploads, then restart web, celery_worker and celery_beat. The sign-up page then shows Sign Up Closed.
Dump the database with pg_dump from the db container, and archive media_files, .secret_key, .env, your override file and local_settings.py from /opt/mediacms, under umask 077. Restore the dump with pg_restore --exit-on-error into a recreated database, the application stopped, then extract the archive.
Take a backup, then in /opt/mediacms run git fetch --tags, git checkout --merge with the new release tag, docker compose pull and docker compose up -d. The code comes from the checkout, so the checkout and the image move together; the migrations run on their own at start.
A managed VPS covers the server: system, security, monitoring and backups. Our teams also proactively monitor your instance and recommend useful fixes, which you apply. Work inside the application is billed by the hour or at a fixed rate.
Simafri
Let's talk about your project
Tell us what you need in a few words: we will get back to you quickly.
Thank you! Your request has been sent. We'll get back to you shortly.
Prefer email? Write to us at support@simafri.com.