Installing Homarr on Railway

Originally posted in https://discord.com/channels/972958686051962910/972958689155764326/1329852421543039017 how do i fix this
Error [TRPCClientError]: fetch failed

at tn.from (.next/server/src/middleware.js:16:3550)

at <unknown> (.next/server/src/middleware.js:16:33664) {

shape: undefined,

data: undefined,

meta: undefined,

[cause]: TypeError: fetch failed

at tg (.next/server/src/middleware.js:16:7535)

at async t_ (.next/server/src/middleware.js:16:7637) {

[cause]: [AggregateError: ] { code: 'ECONNREFUSED' }

}

}
Error [TRPCClientError]: fetch failed

at tn.from (.next/server/src/middleware.js:16:3550)

at <unknown> (.next/server/src/middleware.js:16:33664) {

shape: undefined,

data: undefined,

meta: undefined,

[cause]: TypeError: fetch failed

at tg (.next/server/src/middleware.js:16:7535)

at async t_ (.next/server/src/middleware.js:16:7637) {

[cause]: [AggregateError: ] { code: 'ECONNREFUSED' }

}

}
Solution:
Railway | Homarr documentation
Railway is a cloud platform that allows you to deploy your apps with ease. You can deploy Homarr on Railway with a few clicks.
Jump to solution
31 Replies
Cakey Bot
Cakey Bot4d ago
Thank you for submitting a support request. Depending on the volume of requests, our team should get in contact with you shortly.
⚠️ Please include the following details in your post or we may reject your request without further comment: - Log (See https://homarr.dev/docs/community/faq#how-do-i-open-the-console--log) - Operating system (Unraid, TrueNAS, Ubuntu, ...) - Exact Homarr version (eg. 0.15.0, not latest) - Configuration (eg. docker-compose, screenshot or similar. Use ``your-text`` to format) - Other relevant information (eg. your devices, your browser, ...)
Frequently Asked Questions | Homarr documentation
Can I install Homarr on a Raspberry Pi?
Meierschlumpf
MeierschlumpfOP4d ago
@Vishal let's continue here ECONNREFUSED means that it's not reachable, because it says middleware that's not that great. How do you host it?
Vishal
Vishal4d ago
railway.app
Meierschlumpf
MeierschlumpfOP4d ago
Okay makes sense that it does not work then probably. It expects a "HOSTNAME" env variable from docker, but not sure how this works in railway
export const serverFetchApi = createTRPCClient<AppRouter>({
links: [
httpLink({
url: `http://${process.env.HOSTNAME ?? "localhost"}:3000/api/trpc`,
transformer: SuperJSON,
headers: createHeadersCallbackForSource("server-fetch"),
}),
],
});
export const serverFetchApi = createTRPCClient<AppRouter>({
links: [
httpLink({
url: `http://${process.env.HOSTNAME ?? "localhost"}:3000/api/trpc`,
transformer: SuperJSON,
headers: createHeadersCallbackForSource("server-fetch"),
}),
],
});
Vishal
Vishal4d ago
what should be the value i'll try if that works
Meierschlumpf
MeierschlumpfOP4d ago
In theory it would be the hostname that it has within docker. Because that does not work it might not be possible at all as it only allows an http endpoint with port 3000
Vishal
Vishal4d ago
hmm I didn't get you
Meierschlumpf
MeierschlumpfOP4d ago
HOSTNAME is an environment variable that is set by docker and would need to be defined, because we can not just access the trpc endpoint from outside the container
Vishal
Vishal4d ago
if i define "HOSTNAME" env variable will that work HOSTNAME=3000
Meierschlumpf
MeierschlumpfOP4d ago
Not sure, I don't quite know how it works on railway Maybe it makes more sense to ask them why they dont' have a HOSTNAME env variable set (if this is the case)
Vishal
Vishal4d ago
ok let me try asking them done fixed
Meierschlumpf
MeierschlumpfOP4d ago
Okay and how? Maybe we could add a installation guide to the docs
Vishal
Vishal4d ago
here's the template I have updated https://railway.com/template/_c4Kr9 can add this Markdown to the docs
[![Deploy on Railway](https://railway.com/button.svg)](https://railway.com/template/_c4Kr9)
[![Deploy on Railway](https://railway.com/button.svg)](https://railway.com/template/_c4Kr9)
Railway
Deploy Homarr on Railway
A simple, yet powerful dashboard for your server.
Vishal
Vishal4d ago
i had to add PORT=3000 and HOSTNAME=0.0.0.0
Meierschlumpf
MeierschlumpfOP4d ago
But thats not correct, right?
No description
Vishal
Vishal4d ago
aah somehow it takes time to update
Meierschlumpf
MeierschlumpfOP4d ago
Okay I see Is this template also available as code or only as template
Vishal
Vishal4d ago
only the template no code i guess
Meierschlumpf
MeierschlumpfOP4d ago
Okay so the template is like a form where you fill out custom env variables, docker image and tag and so on?
Vishal
Vishal4d ago
No description
Vishal
Vishal4d ago
it shows updated yes
Meierschlumpf
MeierschlumpfOP4d ago
Great okay But that also means you have to manually update it (nvm you have latest)
Vishal
Vishal4d ago
yes but if i add versions i have update manually but the tag i have put as latest so i don't need to update or maybe i misunderstood your question
Meierschlumpf
MeierschlumpfOP4d ago
It was not a question and rather me thinking loud, sorry I noticed while writing the sentence, that you have latest and so don't need to update it in that regard
Vishal
Vishal4d ago
here's the one with my referral its upto you both are same https://railway.com/template/_c4Kr9?referralCode=vishify Markdown
[![Deploy on Railway](https://railway.com/button.svg)](https://railway.com/template/_c4Kr9?referralCode=vishify)
[![Deploy on Railway](https://railway.com/button.svg)](https://railway.com/template/_c4Kr9?referralCode=vishify)
its ok i got it
Meierschlumpf
MeierschlumpfOP4d ago
👍🏽 Thanks
Vishal
Vishal4d ago
and the demo i think its not the latest right
Meierschlumpf
MeierschlumpfOP4d ago
Yeah it's still the old one, I'll have to find out how to change it xD
Vishal
Vishal4d ago
would that be the same link
Meierschlumpf
MeierschlumpfOP4d ago
One of the other devs had made it initially. Yes will be the same link
Solution
Meierschlumpf
Meierschlumpf4d ago
Railway | Homarr documentation
Railway is a cloud platform that allows you to deploy your apps with ease. You can deploy Homarr on Railway with a few clicks.

Did you find this page helpful?