How to deploy Python FastAPI Application into Railway App?

Published 3 Jan, 2023

Reading time: 2 Mins

Details about how to deploy FastAPI project into railway app in very easy steps

I’ve been deploying my SaaS application into It’s one of the great PaaS provider out there. There is no configuration you need to do in order this to work. You just have to bring the code and it automatically deploy your app.

Also to start railway offers a free program where you can have the development plan for 5$/Month. In this plan you can have the database and the services for free

How to prepare the Project?

To prepare the project you need to have the Procfile because it uses the Nixpacks to build and deploy your project. Nixpacks build process is very similar to Heroku. All you need is to create the Procfile in your root folder. And add these code.


web: uvicorn app:app --host --port $PORT

This is like an entrypoint to your app. You tell the build process to use the above command to run your project.

How to access over the internet? doesn’t expose your project as soon as it’s deployed. You have to goto dashboard and click the service and then click settings. There you can find the domains. You can click the domain to request for the new custom domain or if you have your own domain then you can have the options to point it to the deployed services.

How to automate the deployment process?

You can also connect your Github code and it automatically deploy your project whenever you push it to the main branch. Click the service and go to settings after that you have the option to connect with your Github account.

Select auto deployenmnt and select the branch you wanted to get the source from when the new commits push to Github.

Read More