Clone and deploy this template on Railway:
Infrastructure, Instantly
Develop code in a cloud that feels local. When you're ready, deploy from anywhere
Following the Railway.io docs: https://docs.railway.app/. Inside this project, cd starter
.
Step 1. Install railway
CLI https://docs.railway.app/cli/installation
Step 2. Sign up or sign in and go to your dashboard https://railway.app/dashboard (you can sign up with email or with your GitHub account)
You might have to verify your account (promise not to do anything fishy)
Step 3. Log in with railway login
and follow the prompts
Step 4. Create a new project
4a Option 1: In your dashboard, create a new Empty Project
You'll be presented with a project ID, e.g. a4dd399d-494e-4b2f-944a-ebc05be245df
Link to this project using CLI (copy from dashboard settings)
export ID="a4dd399d-494e-4b2f-944a-ebc05be245df"
railway link $ID
4b Option 2: use CLI, select Empty Project
railway init
Step 5. Add your project to the folder
If you have a Dockerfile in your project directory, you can just run railway run
with no arguments to build and run the Dockerfile.
As in Heroku, you need the PORT
variable: https://docs.railway.app/deployment/up
You'll see something like:
🎉 Built railway-local/hot-rainstorm-production:latest
🚂 Running at 127.0.0.1:4411
Follow the link and test the app. Ctrl+C to kill.
Step 6. Deploy your app:
railway up
The assigned *.up.railway.app
domain times out instantly: https://feedback.railway.app/bug-reports/p/websocket-issue
Custom domain is supposed to work https://docs.railway.app/deployment/custom-domains
Step 7. Custom domain
- Select the environment and enter your domain name
- Add the
CNAME
record to the DNS settings for your domain - Wait for Railway to verify your
CNAME
record
Once a custom domain has been correctly configured, Railway will automatically generate and apply a Let's Encrypt certificate.
Stater plans are designed to help you evaluate Railway and are fit for hobbyist projects. You get access to all features on Railway and you have no limits to the amount of projects you can provision.
Starter plans get $5 of credits that do not accumulate.