Use the Railway CLI to kickoff a deploy within a service in a project from the command line. In a connected project run
The linked project directory will be deployed to the currently selected Railway project and environment (if running from a subdirectory, the project root is still deployed). If there is only one service in the project,
up will deploy to that target.
railway status or run
--verbose to see
which project and environment will be used.
If there is more than one service within a project, the CLI will prompt you which service to deploy to.
All deployments will appear within the service on your project canvas. Clicking on the build will bring up the build and deploy logs. Each deploy gets a unique URL and is considered immutable.
If pointed to a GitHub service, the
up deploy build will replace the active deploy with the
up service. When an empty service is selected within the deployment prompt, the empty service will become a CLI service.
Keep in mind, Railway takes a snapshot of your code payload from your machine. This command may fail for large repos that are larger than 50mb.
If you are starting a server, you need to use the
PORT environment variable.
This is how Railway can expose your deployment. If you see a "Bad Gateway"
error, you most likely are not listening on
Edit this file on GitHub