a year ago
Dub.co is a popular and currently the best link attribution platform that supports conversion tracking. I tried to deploy it myself but am facing issuing in it as it's monorepo and i don't have much experience in coding and deployment too.
I will be happy to pay a small amount to anyone who can help me in it's deployment. Also, you can make this template and others will also be able to use this which will a decent bounty for you at no extra efforts.
Github - https://github.com/dubinc/dub
23 Replies
a year ago
Hey there! We've found the following might help you get unblocked faster:
- 🧵 PostHog Template crashing on Deployment
- 🧵 Deployment crash of n8n template
- 🧵 Monorepo Deployment Issues
- 🧵 Env not found Deployment error using monorepo
If you find the answer from one of these, please let us know by solving the thread!
a year ago
This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.
Status changed to Open brody • 11 months ago
noahd
Loudbook and I have started work on this 🙂
a year ago
Thanks, buddy, let me know when you complete it, i will be happy to try and report any issue if arise.
10 months ago
Dub analystics are using a SaaS, cannot be fully selfhosted on railway
10 months ago
Also the databases are using a SaaS, upstash sdk, which cannot be selfhosted
10 months ago
Exactly, its an app made for vercel and other similar apps, practically impossible unless you make a massive codebase change
10 months ago
Well, the bounty is there until someone presents a quality template that isn't a fork.
10 months ago
its not possible without external services
irazvan2745
Also the databases are using a SaaS, upstash sdk, which cannot be selfhosted
10 months ago
I understand that there are some dependencies that can't be self-hosted, like Upstash, Cloudflare R2, etc, and that's totally ok. You can define those as environment variables wherever self-hosting is not possible.
I want a template that makes the deployment easy. I already have all dependencies ready, but I am still unable to host the application on Railway. It's a monorepo, and I don't have much coding experience, and in deployment too.
noahd
Loudbook and I have started work on this 🙂
10 months ago
Hey buddy, any update?
10 months ago
Yep, as OP said, I don't expect the template to self host the external dependencies that dub requires, they can be be input as environment variables.
dheerajydv19
Hey buddy, any update?
10 months ago
Have been working on job related things unfortunately so I have been unable to work too much. Working n it now though and will make progress over the day.
10 months ago
Hey dheerajydv19.
Building the plain image from the dub repo does seem to be outputting this weird error. I wonder if we can disable type checking based on an ENV flag to make building on Railway better.
Doing a bit more investigating with this before I give a solid "this doesnt work" but it might involve some config being PRed into the project if that's alright.
Attachments
brody
Yep, as OP said, I don't expect the template to self host the external dependencies that dub requires, they can be be input as environment variables.
10 months ago
might aswell just use dub directly atp, anyways, good luck noah and loudbook
10 months ago
Yeah it looks like it is quite a bit more complex to create then I would hope. I think I'll pass on working on it (too much time to be worth the bounty) but Loudbook is probably still interested.
10 months ago
So I did more looking into this and unfortunately the dub codebase currently has an error which wont allow you to build.
Apps > web > app > (ee) > api > cron > groups > create-default-links > routes.ts 149:17
Are you or any of the dub maintainers able to shed some light on this or fix in your end?

It also looks like the previews deployments are also all failing as of ~8 hours ago
noahd
Hey dheerajydv19\. Building the plain image from the dub repo does seem to be outputting this weird error. I wonder if we can disable type checking based on an ENV flag to make building on Railway better. Doing a bit more investigating with this before I give a solid "this doesnt work" but it might involve some config being PRed into the project if that's alright.
10 months ago
Hey, i am not a maintainer of dub, i am just a normal user trying to use that open-source project into one of my project. You can submit a PR but it's acceptance is not in our control.
noahd
So I did more looking into this and unfortunately the dub codebase currently has an error which wont allow you to build. Apps > web > app > (ee) > api > cron > groups > create-default-links > routes.ts 149:17 Are you or any of the dub maintainers able to shed some light on this or fix in your end?  It also looks like the previews deployments are also all failing as of \~8 hours ago
10 months ago
I also came across these issues, and some problems got fixed when you use the correct package version.
Package Version
node v23.11.0
pnpm 9.15.9
The project is not building correctly locally - verify your versions of node and pnpm Match the recommended versions above. Delete all node_modules, .next, and .turbo directories in the apps and packages directory. You may now reinstall node_modules by running pnpm install and attempt to rebuild the project with pnpm build.
Some issues will get fixed by doing this, some will still remain, which I don't know how to resolve. I mostly code in Python and am new to frontend.
25 days ago
Phew, this was easier said than done, but it's done now and available here 👉 https://railway.com/deploy/dub-railway?referralCode=aceweb&utm_medium=integration&utm_source=template&utm_campaign=generic
The catch is that Dub isn't really built to self-host outside Vercel, so a few things needed solving:
- Database: Dub queries MySQL through PlanetScale's serverless HTTP driver, so the template runs a tiny ps-http-sim proxy in front of a standard Railway MySQL to speak that protocol.
- Build: Railway's security scanner blocks Dub's pinned Next.js CVE (bumped it across the workspace), and a couple of routes need env present at build time (handled with placeholders). Build uses the public DB URL, runtime uses the private one.
- Dashboard: Dub hardcodes app.dub.co, so a plain deploy just showed "Link Not Found". Patched it so your Railway domain is treated as the app domain and login works out of the box.
What's in it: three wired services (Dub app + MySQL + the proxy), auto-generated secrets, and the database fully auto-wired. You just bring your own Upstash (Redis + QStash), Tinybird, object storage, and one login method (GitHub/Google OAuth or Resend).
Take it for a spin and let me know how it works. 😄
aceweb
Phew, this was easier said than done, but it's done now and available here 👉 https://railway.com/deploy/dub-railway?referralCode=aceweb&utm_medium=integration&utm_source=template&utm_campaign=generic The catch is that Dub isn't really built to self-host outside Vercel, so a few things needed solving: - **Database**: Dub queries MySQL through PlanetScale's serverless HTTP driver, so the template runs a tiny ps-http-sim proxy in front of a standard Railway MySQL to speak that protocol. - **Build**: Railway's security scanner blocks Dub's pinned Next.js CVE (bumped it across the workspace), and a couple of routes need env present at build time (handled with placeholders). Build uses the public DB URL, runtime uses the private one. - **Dashboard**: Dub hardcodes app.dub.co, so a plain deploy just showed "Link Not Found". Patched it so your Railway domain is treated as the app domain and login works out of the box. **What's in it**: three wired services (Dub app + MySQL + the proxy), auto-generated secrets, and the database fully auto-wired. You just bring your own Upstash (Redis + QStash), Tinybird, object storage, and one login method (GitHub/Google OAuth or Resend). Take it for a spin and let me know how it works. 😄
24 days ago
forks arent allowed
24 days ago
hmm aren't allowed by whom? it's not possible to make it work without a fork as their repo cannot possibly be built on railway, and also needs some slight customizations to make it work well and have everything it needs. Anyway the template is there for anybody that needs it
dheerajydv19
Thanks, buddy, let me know when you complete it, i will be happy to try and report any issue if arise.
20 days ago
Hi dheerajvydv19, do you still need this? https://railway.com/deploy/dub-railway?referralCode=aceweb&utm_medium=integration&utm_source=template&utm_campaign=generic


