How to Install RomM on a VPS with Docker: Your Own Retro Game Library
Retro game collections have a bad habit: they scatter. One folder holds Game Boy Advance ROMs on the laptop, another holds PlayStation ISOs on an external drive, BIOS files hide in the downloads folder, and emulator saves on the phone never make it anywhere. Every time you want to play one old title, you spend your time hunting for its file first, then guessing which emulator can open it, then looking for your last save all over again.
RomM tidies all of that into one place. It is a game collection manager — a ROM Manager — that runs on your server: it reads your game folders, pulls covers, descriptions, and metadata from metadata providers, presents everything in a clean web interface, and even runs some games directly in the browser through emulators. This guide installs it on a VPS with Docker Compose following RomM's official Quick Start guide (MariaDB + Valkey), with the correct folder structure and HTTPS behind Nginx.
One thing that must be clear from the start: RomM does not provide games. It only manages a collection you already own — ROM files from games you possess, dumped from your own cartridges or discs. Do not use this guide to hunt for or download pirated games; that is not what RomM is for, and not what this article is about.
Prerequisites
- A Linux VPS with Docker and Docker Compose v2 installed. A practical baseline: 2 CPUs and 4 GB of RAM for personal use — metadata scanning and in-browser emulation need room to breathe.
- A domain already pointing at the VPS IP, for example
games.example.com. This article uses that domain; replace it with yours. - SSH access to the VPS with
sudorights. - Your own game (ROM) files, already organized by platform. If you do not have any yet, prepare a few files for testing first — without game files, RomM only shows an empty library.
- An account with at least one metadata provider — ScreenScraper (free) is the easiest starting point. Scans still run without metadata credentials, but the official documentation recommends setting up at least one provider before the first scan, since matching quality and companion-app integrations can fail without one.
- Port
8080free on the VPS.
Check Docker and Compose first:
docker --version
docker compose version
Expected output: both commands print a version number without errors.
Step 1: prepare the library, assets, and configuration folders
Create a working folder at /opt/romm and move into it:
sudo mkdir -p /opt/romm
cd /opt/romm
RomM keeps four things on the host: the game library, assets (saves, states, screenshots), configuration, and the database. Create those folders now:
sudo mkdir -p library/roms library/bios assets config
Expected output: four folders appear inside /opt/romm. This folder layout follows the official guide: library will be mounted to /romm/library inside the container, assets to /romm/assets, and config to /romm/config.
The folder structure inside library is the part that decides whether scanning succeeds. RomM's official documentation describes two layouts, and the recommended one — Structure A — separates ROMs and BIOS at the top level, with platform folders inside:
library/
├── roms/
│ ├── gba/
│ │ ├── game-1.gba
│ │ └── game-2.gba
│ └── gbc/
│ └── game-3.gbc
└── bios/
└── gba/
└── gba_bios.bin
Platform folder names must match a slug RomM knows — gba, gbc, snes, ps, for example — not free-form names like gameboy-advance or super_nintendo. The full slug list is on the Supported Platforms page in the official documentation. If your folders are named differently, the mapping can be overridden through config.yml, but for a first install, just follow the official slugs.
One important note from the documentation: since version 5.3, RomM no longer guesses your folder layout. Structure A above is auto-detected, but if your library uses the other layout (one folder per platform with roms/ inside it — Structure B), you must declare it in config.yml. Step 3 covers that.
Step 2: write the .env file and docker-compose.yml
All secrets — database passwords and the auth key — live in one .env file in /opt/romm, not scattered through the Compose file. Generate the auth key first:
openssl rand -hex 32
Expected output: a single line of 64 hexadecimal characters, for example 03a054b6ca27e0107c5eed552ea66becd9f3a2a8a91e7595cd462a593f9ecd09. Copy that value — it becomes your ROMM_AUTH_SECRET_KEY.
Now create .env:
sudo nano .env
Fill it in with your own values. Replace every placeholder with a long, randomly generated password — do not use the examples below as they are:
MARIADB_ROOT_PASSWORD=replace-with-a-long-mariadb-root-password
MARIADB_PASSWORD=replace-with-a-long-romm-database-password
DB_PASSWD=replace-with-a-long-romm-database-password
ROMM_AUTH_SECRET_KEY=paste-the-openssl-rand-hex-32-output-here
SCREENSCRAPER_USER=your-screenscraper-username
SCREENSCRAPER_PASSWORD=<redacted>
Note: MARIADB_PASSWORD and DB_PASSWD must be exactly the same — one is used by the database container, the other by the RomM app to connect to that database. A single differing character and RomM will not start.
Next, create docker-compose.yml. This file follows the reference file from RomM's official Quick Start guide (version 5.4.0), with two adjustments: secret values are read from .env, and the host port is changed from 80 to 8080 so it does not clash with the Nginx installed in step 6:
sudo nano docker-compose.yml
volumes:
mysql_data:
romm_resources:
romm_redis_data:
services:
romm:
image: rommapp/romm:latest
container_name: romm
restart: unless-stopped
environment:
- DB_HOST=romm-db
- DB_NAME=romm
- DB_USER=romm-user
- DB_PASSWD=${DB_PASSWD}
- ROMM_AUTH_SECRET_KEY=${ROMM_AUTH_SECRET_KEY}
- SCREENSCRAPER_USER=${SCREENSCRAPER_USER}
- SCREENSCRAPER_PASSWORD=${SCREENSCRAPER_PASSWORD}
- HASHEOUS_API_ENABLED=true
volumes:
- romm_resources:/romm/resources
- romm_redis_data:/redis-data
- ./library:/romm/library
- ./assets:/romm/assets
- ./config:/romm/config
ports:
- "8080:8080"
depends_on:
romm-db:
condition: service_healthy
restart: true
romm-db:
image: mariadb:latest
container_name: romm-db
restart: unless-stopped
environment:
- MARIADB_ROOT_PASSWORD=${MARIADB_ROOT_PASSWORD}
- MARIADB_DATABASE=romm
- MARIADB_USER=romm-user
- MARIADB_PASSWORD=${MARIADB_PASSWORD}
volumes:
- mysql_data:/var/lib/mysql
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
start_period: 30s
start_interval: 10s
interval: 10s
timeout: 5s
retries: 5
What each part does:
rommis the web app: the officialrommapp/rommimage, listening on port 8080 inside the container. TheDB_*variables tell the app how to find the MariaDB database in theromm-dbservice.romm-dbis the MariaDB database holding the entire catalog, user accounts, and metadata. Themysql_datavolume keeps that data even if the container is removed and recreated.romm_resourcesstores covers and screenshots fetched from IGDB,romm_redis_datastores cache for background tasks (Valkey runs embedded inside the image, so no separate cache container is needed in this reference setup).depends_onwithservice_healthymakes sure RomM only starts once MariaDB is genuinely ready — without it, RomM often fails to start because the database has not finished initializing, then falls into a restart loop.- Other metadata provider credentials — RetroAchievements and SteamGridDB — can be added later as
RETROACHIEVEMENTS_API_KEYandSTEAMGRIDDB_API_KEYin.envand in the environment list. For a first install, ScreenScraper alone is enough.
Step 3: write config.yml and place the first game files
Create the configuration file in the config folder:
sudo nano config/config.yml
For a library using Structure A from step 1, RomM uses its defaults and this file may be empty — but spelling it out makes your intent clear and avoids confusion later:
filesystem:
structure:
default: "roms/{platform}/{game}"
firmware: "bios/{platform}"
Those two lines are the defaults written out explicitly, matching the official documentation on folder structure. If your library uses Structure B (one folder per platform with roms/ and bios/ inside), replace that block with:
filesystem:
structure:
default: "{platform}/roms/{game}"
firmware: "{platform}/bios"
Without that declaration, RomM 5.3 and later refuses to start when it detects an undeclared Structure B layout — a documented behavior change, not a bug.
Now place a few game files in the right folders. For two Game Boy Advance games, for example:
sudo cp /path/to/your-game-1.gba library/roms/gba/
sudo cp /path/to/your-game-2.gba library/roms/gba/
ls -R library/roms
Expected output: the ls command shows the library/roms/gba/ structure holding your game files. If your platform needs a BIOS (PlayStation, for example), put the BIOS file in library/bios/<platform>/. BIOS is optional — only platforms that actually require firmware for emulation need that folder.
Step 4: start the stack and create the admin account
From /opt/romm, run:
sudo docker compose up -d
sudo docker compose ps
Expected output: romm and romm-db both show as running. On the first run, Docker pulls the rommapp/romm and mariadb images, brings the database up, waits for the healthcheck, then brings the app up. This takes one to two minutes — do not panic if the web page does not open immediately. Check the logs if in doubt:
sudo docker compose logs --tail=50 romm
Open http://YOUR-VPS-IP:8080 in a browser. On first start you are redirected to the Setup Wizard. Create an admin username and password — the first user created always gets the Admin role. Use a strong password and keep it in a password manager.
Expected output: after logging in, you see RomM's library, still empty and ready to fill. If the wizard does not appear and you see an error page instead, read the RomM container logs first — the cause is almost always there, not in the browser.
Step 5: scan the library and complete the metadata
Now the part that proves the whole install: scan the game files you placed in step 3.
- In RomM's interface, open the library scan page (usually through the Library menu or a Scan button).
- Run the scan. RomM reads the
library/romsfolder, recognizes platforms from the folder names, then matches each file against the metadata providers whose credentials you filled in.env. - Wait for the scan to finish. For the first few files this is fast; for hundreds of games, give it a few minutes.
Expected output: each game shows up with a cover, the correct title, a description, and platform information. If one game is not recognized or has the wrong cover, fix it from that game's detail page — the cause is usually a filename that does not follow the common pattern, or a platform misidentified because the folder name does not match the official slug.
Two things worth trying once the first scan succeeds:
- Play in the browser. RomM runs some games directly in the browser through emulators (for classic platforms, for example). Click a game and try the Play button — not every platform is supported, but for light games this is the fastest way to check that your ROM files are actually valid.
- Add users. Create separate accounts for family members from the Users page. The admin account stays yours; other viewers do not need the keys to the warehouse.
Step 6: put Nginx in front with HTTPS
Do not leave RomM on plain HTTP, since login credentials and play sessions travel over that connection. Create /etc/nginx/sites-available/romm:
server {
listen 80;
server_name games.example.com;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
The Upgrade and Connection headers matter: the in-browser emulator and RomM's real-time features use WebSocket, and without those headers play sessions can fail to connect or drop repeatedly. Enable the configuration and issue the certificate:
sudo ln -s /etc/nginx/sites-available/romm /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
sudo certbot --nginx -d games.example.com
Expected output: nginx -t reports test is successful, and Certbot reports the certificate was issued. Afterwards, reach RomM at https://games.example.com and repeat the login plus one scan through the domain.
One thing not to skip: if you reach RomM through a domain, set ROMM_BASE_URL=https://games.example.com in .env (and add - ROMM_BASE_URL=${ROMM_BASE_URL} to the romm service's environment list), then restart with sudo docker compose up -d. RomM uses this variable for links it generates itself — invites, QR codes, and login redirects — so they all point at the correct public address instead of an IP with a port.
Troubleshooting
The romm container keeps restarting.
Check the logs with sudo docker compose logs --tail=50 romm. The most common cause: DB_PASSWD in .env does not match MARIADB_PASSWORD, or the database was not healthy when RomM started. Make sure both passwords are identical, then run sudo docker compose down && sudo docker compose up -d — the healthcheck on romm-db holds RomM back until the database is ready.
The web page does not open after docker compose up -d.
Allow one to two minutes on the first run — MariaDB needs time to initialize and the healthcheck has a 30-second start_period. Check status with sudo docker compose ps and logs with sudo docker compose logs --tail=50 romm-db. If romm-db itself fails to start, the cause is almost always a mysql_data volume corrupted by an earlier attempt: stop the stack, remove the volume with sudo docker volume rm romm_mysql_data (check the name with sudo docker volume ls), then start again. Note: removing the volume deletes the entire catalog — only do this before any important data is in it.
The scan finishes but no games appear.
Check in order: (1) the files are actually in library/roms/<platform>/ with ls -R library/roms, (2) the platform folder name matches the official slug (for example gba, not gameboy-advance), (3) the ./library:/romm/library volume is mounted correctly — check with sudo docker compose exec romm ls /romm/library/roms. If the folder is empty inside the container while the host has files, the mount path in docker-compose.yml is wrong.
Games appear but with no cover or metadata.
That means no metadata provider could be reached. Check the ScreenScraper credentials in .env — the username and password must be correct, and ScreenScraper limits requests for free accounts, so a large first scan can take a while. Also confirm HASHEOUS_API_ENABLED=true is in the environment. After fixing the credentials, restart the container and rescan the affected games.
A library structure error when the container starts.
Since RomM 5.3, an undeclared Structure B layout makes the container refuse to start. Read the log message: if it mentions filesystem.structure, add the matching structure block to config/config.yml as in step 3, then restart.
Port 8080 is already used by another application.
Stop that application, or change the port mapping in docker-compose.yml (for example "8081:8080"), keeping in mind the access address and ROMM_BASE_URL must be adjusted. Port 80 in the official reference file was deliberately changed to 8080 in this guide so it does not clash with Nginx.
Summary table
| Component | Role | Port | Notes |
|---|---|---|---|
| romm | The RomM web app | 8080 | Image rommapp/romm:latest |
| romm-db | MariaDB database | Internal to Docker | Image mariadb:latest, volume mysql_data |
| mysql_data | Catalog, accounts, metadata | /var/lib/mysql in the container | Must be in the backup plan |
| romm_resources | Covers and screenshots from IGDB | /romm/resources | Named volume |
| romm_redis_data | Background-task cache (Valkey) | /redis-data | Named volume |
| library | Game collection | ./library:/romm/library | Structure A: roms/{platform}/, bios/{platform}/ |
| assets | Saves, states, screenshots | ./assets:/romm/assets | Host bind mount |
| config | config.yml | ./config:/romm/config | Folder structure declared here |
| ROMM_AUTH_SECRET_KEY | App auth key | — | From openssl rand -hex 32, kept in .env |
| Nginx | Reverse proxy + HTTPS | 80 / 443 | Must forward WebSocket headers; set ROMM_BASE_URL |
Pre-finish checklist
- Both containers
rommandromm-dbare running. - The Setup Wizard is done and the admin account exists.
MARIADB_PASSWORDandDB_PASSWDare exactly the same in.env.- The first scan succeeded: games show up with correct covers and metadata.
- One game plays from the browser (for a supported platform).
- RomM is reached at
https://games.example.com(replace with your domain) with a valid certificate. ROMM_BASE_URLholds the domain address and the stack has been restarted.- The
mysql_datavolume and thelibraryfolder are covered by your backup plan.
One habit that keeps this library tidy: every time you add new games, place them in the right platform folder right away and run a scan before adding the next batch. Piling up hundreds of files without scanning, then fixing them later, is far more tiring than tidying a little at a time.
Which retro game do you want to play again first from your own library — and on which platform? Tell us in the comments, and if any step above fails on your VPS, paste the error message so it can be discussed together.
Read also: Rnevio's article "Jellyfin: Your Own Free Media Server — Watch Your Collection Anywhere" organizes films and shows on the same server, while the companion guide in this batch is the Trilium Notes guide to a personal knowledge base.


Diskusi
Ada pertanyaan atau pengalaman yang ingin dibagikan?
Komentar ditinjau sebelum ditampilkan. Mari berdiskusi dengan sopan dan sesuai topik.
Tulis komentar