Skip to main content
Back to blog

Deploying apps with Railway

·3 min readWeb Dev

Heroku used to be the default for deploying side projects. Then they killed their free tier and the developer community scattered. I tried a few alternatives and landed on Railway for most of my smaller deployments.

What Railway does well

Railway connects to your GitHub repo, detects your framework, builds it, and deploys it. No Dockerfiles required (though you can use them). No YAML configuration files. Push to main and your app is live in a couple of minutes.

The dashboard gives you logs, metrics, environment variables, and deployment history in one place. It feels like what Heroku should have become.

Setting up a project

Sign up, connect your GitHub account, and create a new project. You can either deploy from a repo or use one of their templates.

For a Node.js app, Railway detects the package.json, runs npm install and npm start (or whatever your start script is), and exposes the app on a generated URL.

Environment variables are set in the dashboard. No .env files to manage on the server side:

DATABASE_URL=postgresql://...
NODE_ENV=production
API_KEY=your-secret-key

Databases included

Railway has first-class support for PostgreSQL, MySQL, Redis, and MongoDB. Click "New Service," pick your database, and it is provisioned instantly. The connection string shows up as an environment variable that you can reference in your app.

No external database hosting needed for most projects. The databases run alongside your app in the same project, which keeps latency low and billing simple.

Pricing

Railway uses a usage-based model. You pay for CPU, memory, and network. For small apps that do not get much traffic, the cost is a few dollars a month. There is a free trial tier with $5 of credits that renews monthly, which is enough for experimenting.

The pricing is predictable because you can see exactly what each service costs in the dashboard. No surprise bills at the end of the month.

When Railway is the right choice

Railway shines for side projects, prototypes, and small production apps. If you need a backend API, a web app with a database, or a cron job runner, Railway gets you there faster than setting up your own server.

For larger production workloads, you might want more control over infrastructure. At that point, a VPS with Docker or a managed Kubernetes service makes more sense. But for the 90% of projects that do not need that complexity, Railway is hard to beat.

What I deploy on it

I use Railway for API backends that power small projects, webhook receivers, and anything that needs a database but does not justify managing a server. The deploy-on-push workflow means I can iterate quickly without thinking about infrastructure.

Sources

Enjoying the blog? Subscribe via RSS to get new posts in your reader.

Subscribe via RSS