All Templates / Storage

MongoDB

MongoDB

Mongo database with data persistence and TCP Proxy

Deploy MongoDB

MongoDB

mongo

Just deployed

/data/db

Overview

Mongo database deployed with the official Docker image.

  • A volume is mounted to the service to persist data between builds.

  • TCP proxying is configured to allow accessing the database from anywhere.

Start Command

The Mongo container deployed from this template is started with the following command, to enable communication over IPv6 (required for Private Networking): docker-entrypoint.sh mongod --ipv6 --bind_ip ::,0.0.0.0

How to use

Reference the MONGO_URL variable from your service to connect to the database in your tool of choice (e.g. ${{Mongo.MONGO_URL}})

Connecting

Connect to the database using the proxied domain and port found on the service Settings page. The password can be found on the Variables page.

In a terminal, for example:

mongo mongodb://mongo:PASSWORD@TCP_PROXY_DOMAIN:TCP_PROXY_PORT

Template Content

MongoDB

mongo
Deploy Now

Details

Railway Templates

Created on Sep 9, 2023

5266 total projects

3148 active projects

Storage



More templates in this category

View Template
ReadySet

ReadySet

A lightweight caching engine for Postgres


Milo

View Template
EdgeDB

EdgeDB

EdgeDB template based on their Docker deployment guide


Ajit Krishna

View Template
Apache Kvrocks

Apache Kvrocks

A drop-in replacement for Redis to store data on a volume.


Bram