Your First Railway Deployment
Deploying your first application

Sprout presents
One push, one build, one public URL. I will also show you the rollback button, which I consider the most underrated feature in software.One push, one build, one public URL. I will also show you the rollback button, which I consider the most underrated feature in software.

This is where it all comes together. You're about to take code sitting on GitHub and put it live on the internet. Give it a few minutes and you'll have a working app that literally anyone in the world can visit.
What You'll Need#
Before we start, make sure you've got these.
- A Railway account (from the previous lesson)
- A GitHub account with at least one repository
- A project to deploy (any web app will work)
Deploying from GitHub#
Let's walk through it one step at a time.
Step 1. Create a New Project#
From your Railway dashboard, click the "New Project" button. You'll see a few options for how to create it.
Step 2. Choose 'Deploy from GitHub repo'#
Click "Deploy from GitHub repo." That tells Railway you want to deploy code that already lives on GitHub.
Step 3. Select Your Repository#
Railway will show a list of your GitHub repositories. Find the one you want and click it.
Can't find your repository? Do this.
- Click "Configure GitHub App" at the bottom
- Give Railway permission to access that specific repo
- Come back and try again
Step 4. Configure Settings (Optional)#
Railway might show you some configuration options. For most projects you can skip this and keep the defaults, because Railway is pretty smart about detecting what your project needs.
If your project needs specific settings, you can add them later.
Step 5. Click Deploy#
Click the "Deploy" button. Railway gets to work right away.
What Happens During Deployment#
After you click deploy, Railway runs through a handful of steps, and you can watch them happen in real time.
Push --> Clone --> Detect --> Install --> Build --> Deploy --> Live!1. Cloning Your Code#
Railway downloads your code from GitHub. Usually that's just a few seconds.
2. Detecting the Project Type#
Railway looks at your files to figure out what kind of app you've got. It can detect these and more.
- Next.js
- React
- Node.js
- Python
- Ruby
- And many more
3. Installing Dependencies#
Railway runs commands like npm install to grab all the packages your app needs. This might take a minute or two.
4. Building Your App#
For apps that need compiling (like Next.js), Railway builds the production version. You'll see build logs scrolling by.
5. Starting Your App#
Finally, Railway starts your app and opens it up to the world.
Getting Your App's URL#
Once the deploy finishes, you need a way to actually visit your app. Railway hands you a URL for that.
Step 1. Find Your Service#
In your project, click the service that just deployed. It's usually named after your repository.
Step 2. Go to Settings#
Look for a "Settings" tab or section inside your service.
Step 3. Generate a Domain#
Find the "Domains" section. Click "Generate Domain" to get a Railway URL.
Your URL will look something like your-app-name.up.railway.app.
Step 4. Visit Your App#
Click the URL or paste it into your browser. Your app is live!
Automatic Deploys#
Here's where Railway gets really good. Every time you push code to GitHub, Railway deploys the new version automatically.
Let's try it out.
Step 1. Make a Small Change#
Open your project on your computer and change something simple, like the text on your homepage.
Step 2. Commit and Push#
Save your changes, commit them with Git, and push to GitHub.
git add .git commit -m "Update homepage text"git pushStep 3. Watch Railway#
Hop back to your Railway dashboard. Within seconds you'll see a new deployment kick off on its own.
Step 4. See Your Changes Live#
When the deployment finishes, refresh your app's URL. Your changes are live!
This automatic deploying is called "continuous deployment," or CD. It means your live app always matches your latest code on GitHub, without you lifting a finger.
Understanding Your Project Dashboard#

Now that you've got a deployed project, let's look around the dashboard.
The Service Card#
This shows your deployed app, including these.
- The service name
- Status (running, deploying, failed)
- Resource usage (CPU, memory)
Deployments Tab#
Click here to see every deployment you've ever made. Each one shows you this.
- When it happened
- What triggered it (usually a GitHub push)
- Whether it succeeded or failed
- Logs from the build process
Variables Tab#
Where you'll set environment variables (we'll cover these later).
Settings Tab#
Configure your service's options, domains, and more.
When Things Go Wrong#
Sometimes deployments fail. It happens to everybody, so don't panic. Here's how to troubleshoot.
Check the Build Logs#
The logs tell you exactly what went wrong. Common culprits look like this.
- Missing dependencies in
package.json - Syntax errors in your code
- Build commands that fail
Look for Error Messages#
Railway highlights errors in red. The message usually tells you what to fix.
Check Your Start Command#
Railway needs to know how to start your app. For Node.js apps, make sure your package.json has a start script.
{
"scripts": {
"start": "node server.js"
}
}Google the Error#
Copy the error message and search for it. Odds are somebody else hit the exact same problem and posted the fix.
Rolling Back#
Deployed something broken? You can go back to an earlier version.
Step 1. Go to Deployments#
In your service, click the "Deployments" tab.
Step 2. Find a Working Deployment#
Scroll through your deployment history for one that worked.
Step 3. Rollback#
Click the three dots at the end of that deployment and pick "Rollback." Railway brings back that version, code and variables both... and you get to breathe again. (Really old deployments can age out of your plan's history, so you can't roll back forever.)
TL;DR#
- Deploy from GitHub by creating a new project and picking your repo
- Railway detects your project type and builds automatically
- Generate a domain to get a URL for your live app
- Automatic deploys happen whenever you push to GitHub
- Failed deployments don't touch your running app
- You can roll back to earlier versions if something breaks
What's Next?#
Your app is live! But most apps need somewhere to keep their data, so next lesson you'll add a database to your Railway project.
This lesson ends with 2 short activities.
