Trouble Deploying Private Docker Image - "Unable to Connect to Registry" Error

bytedaTRIAL

8 months ago

I'm encountering an issue during the deployment process of a private Docker image on Railway. The deployment fails with the following error:

Error:
"We were unable to connect to the registry for this image."

Context:

I’m using a private Docker image hosted on GitHub Container Registry (GHCR).
The error occurs during the "Deploy > Create container" step, as shown in the attached screenshot.
I’ve already added the necessary GitHub Personal Access Token (PAT) with read:packages and repo scopes to the Railway project settings.
Questions:

Is there a specific location or service setting in Railway where I should enter the GitHub PAT for it to be used during the deployment process? The thread on https://help.railway.app/questions/deploy-private-docker-image-c5d6c04d mentions entering credentials in the service settings, but it's unclear where this is exactly.
Do I need to configure anything else besides adding the PAT as a secret or environment variable? Are there additional settings required in Railway to ensure it can access the private registry?I am logged into Railway using GitHub, and I assumed this would provide access to GHCR automatically, but it seems like additional steps are necessary.

View Deploy details

ⓘ Deployment information is only viewable by project members and Railway employees.

1 Replies

8 months ago

Hello,

Deploying private images is a feature that is only available on the Pro plan at this time.

Once on Pro you would be asked for the credits in an input field right under the source settings in the service settings!

https://docs.railway.app/guides/services#deploying-a-private-docker-image