Sign up for an account on Railway - they have a free tier that is sufficient for small applications.
⌘ + /
shortcut)If a database is not required, select Deploy From Repo.
There are two ways to set up your project on Railway:
npm i -g @railway/cli
# or
yarn global add @railway/cli
railway login
cd /path/to/project
railway link your-project-id
The project ID is taken from the Project Setup page.
Blitz requires the SESSION_SECRET_KEY
variable to be set. Go to your
project on the GUI, select the Variables link and enter
SESSION_SECRET_KEY
as the name of the variables a random 32-key secret
as its value. Click Add to add the variable.
Enter other environment variables that you require. The DATABASE_URL
variable will be automatically set by Railway if you provision a
PostgreSQL database.
Verify that the variables are set correctly via your linked project:
railway variables
railway up
Once the build is successful and deployment is completed, you will receive the URL for your application that is now accessible via the internet. To get the URL, go to the Deployments section in the project's dashboard and the URL will be listed under a successful deployment.
You may also view your app logs by running
railway logs
In order to set Railway to build + deploy automatically when you push to a branch on your GitHub repository, connect your GitHub repository by following the GUI steps below from Step 2 onward.
Blitz requires the SESSION_SECRET_KEY
variable to be set. Go to your
project on the GUI, select the Variables link and enter
SESSION_SECRET_KEY
as the name of the variable and a random 32-key secret
as its value. Click Add to add the variable.
Enter other environment variables that you require. The DATABASE_URL
variable will be automatically set by Railway if you provision a database.
Go to the Deployments section. If your project is on GitHub, you can click on Connect GitHub to deploy and connect directly to your repositories on GitHub. Otherwise, you will have to use the CLI to deploy your application.
Select the repository and the branch to deploy from and click Connect + Deploy