Railway Database


Too complicated? Not what you’re looking for?

Consider a hosted Nightscout service! Check for easier solutions here.


Danger

The free plan has been removed Jul 3rd for new users and Aug 1st for existing users.
Documentation will be updated to reflect the changes when visible.


Railway Mongo Database

Railway MongoDB

Railway offers a Mongo database.

Pros:

  • Simple to create

  • Less overhead than Atlas (more space)

  • Mongo database cost is $0.000231/GB/Minute

Cons:

  • You need to carefully monitor your database size and clean it up regularly to remain within the Hobby plan 5$/month limits

  • Simple Mongo 4.4 database


Create a Railway account

If you already have a Railway account, make sure you have a developper plan: go to step g).


a) Open Railway in a new browser tab and click login. Type your email and select Email.

../../../_images/Railway00.png ../../../_images/Railway01a.png

b) Leave the browser open on this screen

../../../_images/Railway01b.png

c) Check your email (look also in the spam folder) and click on the Authorize Railway App.

../../../_images/Railway01c.png

d) Type the code you had in b).

../../../_images/Railway01d.png

e) Close this tab and return to the one you left open in b).

../../../_images/Railway01e.png

f) Click on Please agree to the new terms to keep on using Railway.

../../../_images/Railway03.png

d) Scroll down and click I agree with Railway's Terms of Service.

../../../_images/Railway04.png

e) Scroll down and click I will not deploy any of that.

../../../_images/Railway05.png

f) You should now see this. You’ve created your Railway account.

../../../_images/Railway06a2.png

g) Upgrade your account to a Developer plan. Click on the Unverified and select Remove Resource Limits.

../../../_images/Railway06b2.png

Danger

The free plan will be removed Jul 3rd for new users and Aug 1st for existing users.
Documentation will be updated to reflect the changes when visible.

Enter your credit card information and select Subscribe to a Hobby Plan.

../../../_images/Railway06c.png

Your card will be billed 1$ that will be refund immediately. Bank fees won’t be refund.


Create your database

a) Click New Project from your Dashboard screen (top right).

../../../_images/RailwayDB01.png

b) Click Provision MongoDB

../../../_images/RailwayDB02.png

c) Select your new MongoDB project.

../../../_images/RailwayDB03.png

d) Go to the Connect page.

../../../_images/RailwayDB04.png

e) Scroll down to Available Variables, move the mouse to the end of the line showing the MONGO_URL and click the copy icon.

../../../_images/RailwayDB05.png

This is an important information

Now that you have copied the resulting MONGODB_URI string, keep it in a safe place, you will need it later.