Deploy FerretDB | (Just Updated) MongoDB-Compatible Database on Postgres, Auth On, Persistent

MongoDB-compatible database on Postgres. Auth on, data on a volume.

Deploy FerretDB | (Just Updated) MongoDB-Compatible Database on Postgres, Auth On, Persistent

Just deployed

/var/lib/postgresql

Deploy and Host FerretDB on Railway

FerretDB is an open-source, MongoDB-compatible database. It speaks the MongoDB wire protocol, so existing drivers, mongosh and ORMs connect unchanged, and it stores the documents in PostgreSQL through the DocumentDB extension. This template deploys FerretDB 2.7.0 with the matching DocumentDB-enabled Postgres 17, authentication on, a generated password and a volume for the data. Nothing needs filling in.

About Hosting FerretDB

The template runs two services. postgres is the official ferretdb/postgres-documentdb image, pinned by digest, with the extension created at first boot and its data on a volume mounted at /var/lib/postgresql. ferretdb is the official ferretdb/ferretdb image, pinned by digest, listening on port 27017 and reachable through a TCP proxy. Client logins are checked against the database user, so anonymous commands are rejected. Telemetry is disabled.

Why Deploy FerretDB on Railway?

  • A MongoDB-compatible endpoint with an open-source licence and no mongod process.
  • Authentication is on and the password is generated per deploy.
  • Documents live in Postgres on a volume, so a redeploy keeps them.
  • A public TCP proxy URL and a private-network URL are both provided as variables.

Common Use Cases

  • Running a MongoDB-based app without a mongod server or its licence terms.
  • Local and CI databases for code that uses a MongoDB driver.
  • Giving AI agents a document store they can reach with a standard connection string.
  • Keeping documents and relational tables in the same Postgres instance.

Dependencies for FerretDB Hosting

Deployment Dependencies

Machine-readable contract

service: ferretdb
protocol: MongoDB wire (TCP, port 27017)
public_url_variable: MONGO_PUBLIC_URL   (mongodb://:@:/)
private_url_variable: MONGO_PRIVATE_URL (mongodb://:@:27017/)
credential_variables: MONGO_USER, MONGO_PASSWORD (generated, on the ferretdb service)
health: successful authenticated `ping` over the connection string (no HTTP endpoint)
volumes: /var/lib/postgresql (postgres service)

Check it works:

mongosh "$MONGO_PUBLIC_URL" --eval 'db.getSiblingDB("test").items.insertOne({ok: 1})'

Template Content

More templates in this category

View Template
NEW
RustFS | (Just Updated) S3 Object Store, Public URL and Keys Set
S3-compatible object store, keys and public URL preset, volume kept

SuperSlowSloth
0
View Template
NEW
TimescaleDB
A PostgreSQL-based time-series database for analytics on Railway.

Rakit
1
View Template
Garage S3 Storage
Ultra-light S3 server: fast, open-source, plug-and-play.

PROJETOS
8