Managing Services

A Railway Service is a deployment target for your application.

As you create and manage your services, your changes will be collected in a set of staged changes that you must review and deploy, in order to apply them.

Creating A Service

Create a service by clicking the New button in the top right corner of your project canvas, or by typing new service from the command palette, accessible via CMD + K (Mac) or Ctrl + K(Windows).

GIF of the Services view

Services on Railway can be deployed from a GitHub repository, a local directory, or a Docker image.

Accessing Service Settings

To access a service's settings, simply click on the service tile from your project canvas and go to the Settings tab.

Defining a deployment source

If you've created an empty service, or would like to update the source for a deployed service, you can do so in the Service settings.

Click on the service, go to the Settings tab, and find the Service Source setting.

Screenshot of how to connect a service to a GitHub repo or Docker image

Deploying from a GitHub Repo

Define a GitHub repository as your service source by selecting Connect Repo and choosing the repository you'd like to deploy.

When a new commit is pushed to the linked branch, Railway will automatically build and deploy the new code.

Screenshot of a GitHub deployment trigger

You must link your Railway account to GitHub, to enable Railway to connect to your GitHub repositories. You can configure the Railway App in GitHub by clicking this link.

Deploying a public Docker Image

To deploy a public Docker image, specify the path of the image when prompted in the creation flow.

Railway can deploy images from Docker Hub, GitHub Container Registry, Quay.io, or GitLab Container Registry. Example paths -

Docker Hub:

  • bitnami/redis

GitHub Container Registry:

  • ghcr.io/railwayapp-templates/postgres-ssl:latest

Quay.io:

  • quay.io/username/repo:tag

GitLab Container Registry:

  • registry.gitlab.com/gitlab-cicd15/django-project

Deploying a private Docker Image

If you'd like to deploy from a private Docker registry, ensure you're on the Pro plan.

To deploy from a private Docker registry, specify the path of the image when prompted in the creation flow, as well as authentication credentials (username, password) to the registry.

GIF of the Services view

If deploying an image from GitHub Container Registry, provide a personal access token (classic).

Deploying from a local directory

Use the CLI to deploy a local directory to a service -

  1. Create an Empty Service by choosing Empty Service during the service creation flow.
  2. In a Terminal, navigate to the directory you would like to deploy.
  3. Link to your Railway project using the railway link CLI command.
  4. Deploy the directory using railway up. The CLI will prompt you to choose a service target, be sure to choose the empty service you created.

Deploying a Monorepo

For information on how to deploy a Monorepo click here.

Monitoring

Logs, metrics, and usage information is available for services and projects. Check out the monitoring guides for information on how to track this data.

Changing the Service Icon

Customize your project canvas for easier readability by changing the service icon.

  1. Right click on the service
  2. Choose Update Info
  3. Choose Icon
  4. Begin typing to see a list of available icons, pulled from our deviconsservice.

You can also access this configuration from the command palette.

Approving a Deployment

If a member of a GitHub repo doesn't have a linked Railway account. Railway by default will not deploy any pushes to a connected GitHub branch within Railway.

Railway will then create a Deployment Approval within a Service prompting a user to determine if they want to deploy their commit or not.

screenshot of the deployment approval ui

Deploy the queued deployment by clicking the "Approve" button. You can dismiss the request by clicking the three dots menu and clicking "Reject".

Storing Data

Every service has access to 10GB of ephemeral storage. If your service requires data to persist between deployments, or needs more than 10GB of storage, you should add a volume.

Deleting a Service

Delete a service by opening the project's settings and scrolling to the danger section.


Edit this file on GitHub