railway.com one click deployment problem | Backend started at 8080
After deploying using the Railway template, everything works as expected. However, the backend service is mapped to the default port 8080, while the application requires PORT=3000.
Expected Behavior: The backend should automatically map to PORT=3000 to match the expected configuration.
Actual Behavior: The backend is mapped to PORT=8080, causing misconfiguration issues.
Suggested Fix: Modify the template's environment variable PORT to 3000 to ensure correct deployment.
[Nest] 175 - 02/27/2025, 6:47:23 PM LOG 🚀 Backend is running on: http://localhost:8080/
We do not offer support for Railway, as it isn't listed in the Documentation or anything, that template is just there to get the SaaS Version running, not for OSS Deployers, if you want to use Railway you're going to have to do it yourself with no support.
I'm happy to take issue #340 and work on the documentation and code changes.
Hey, if you could do that, that would be great, I'm happy to assign this to you. @tamilarasi-tech
You need to comment once on the Parent Issue to let me assign it to you.
Hey folks, I was actually working on this off-and-on the past couple of weeks, I was able to fix the issues and have it deployed on my own railway (https://postiz.chadsyntax.com/). I opened this PR https://github.com/gitroomhq/postiz-app/pull/634, happy to work together to get it merged.
Happy to work together @chad-syntax . Working on the docs for Railway One Click Deployment.
Happy to work together @chad-syntax . Working on the docs for Railway One Click Deployment.
Great, I assume that means we need to add some info the this repo's README and submit another PR to https://github.com/gitroomhq/postiz-docs?
I'm thinking we can either just say: "here's the railway template, just click this link and it will fill in all the settings and deploy right away"
OR "here are the full steps on how to set it up from scratch" (still pretty straightforward)
Hey guys @tamilarasi-tech @chad-syntax , how is it going with the railway one click deployment? I tried deploying using this template below but cant even sign up? how did you guys get around it?
and got this error:
I honestly do not know, in another thread I was asked if we could change the template so I wasn't the referrer, as Railway gives monetary kickbacks to the template owner. So that requires the postiz owners to make the template.
I was able to get it running on my own by standing up a service from the docker image, a psql, and a redis using the environment variables I list here in the docs repo.
(Though I'm still not 100% sure if the PORT=5000 env var being present helps or hurts due to some other port related changes recently, if it fails to deploy you could remove PORT and set the service port manually in the railway config.)
@chad-syntax thanks for your response. is this the env that you use? pages/installation/railway.mdx I also use the port=5000 for the public domain.
@chad-syntax thanks for your response. is this the env that you use? pages/installation/railway.mdx I also use the port=5000 for the public domain.
Yes those are the env vars I use, except for the PORT=5000, let me explain further.
Setting PORT to 5000 resulted in two things
- Railway binds the service to that port for hosting
- The postiz nodejs back-end starts on port 5000 which we do not want, it needs to run on 3000 so caddy can run on 5000 and proxy traffic to 3000
But it has been a couple months since last I tested this. The safest option is to omit the port env var and manually bind the service to 5000 in the railway dashboard. It should detect caddy and suggest binding to 5000.
Now if other changes were introduced that are causing new issues, I can't say. If I have some time in the near future I'll see if I can get it running from scratch again.
Thanks @chad-syntax, yes I managed it working.
- The default env in Railway is not accurate so need to update those according to the documentation.
- Did the port binding on port 5000 in Railway UI. Btw I found out that the one in Railway does not have the full fucntionalities like the paid version (like refererral, etc.), do you reckon?
@chad-syntax : I just ran a fresh deploy of your template, and initially got this "App is running!" message, similar to https://github.com/gitroomhq/postiz-app/issues/650:
Here's how I resolved it:
- I updated the port in Settings > Public Networking:


- I changed the PORT env variable value from 5000 to 3000:
- I redeployed the app
Another option that worked is to set the template to PORT=3000 initially, and then edit the Public Networking port after it's been deployed.
Im getting a CORS error. Any help?
Hey guys i'm following up here. i've been able to install it successfully on railways and come to the dashboard, but when i try to login to instagram standalone i get redirect to instagram page with my app-id (the loggedIn account) But then when i'm redirected back to my website i got a 502 to /connect and a message " cannot connect to your account"