DEV Community

Patrick Feeney
Patrick Feeney

Posted on

How to add subdomain to Ruby on Rails 8 Kamal 2

Go to your domain provider and add an 'a record' for your subdomain. In my case I am using Namecheap. I had to create an 'a record' with * as the Host and my server's Ip as the value.

Then in the deploy.yml of Kamal do the following, go to proxy:, and where it says host: just type in the name of the complete subdomain. Example: host: store.mydomain.com. This has to be the same as what you used in your DNS provider.
Then commit that and deploy it running bin/kamal deploy.

If that works after deploying that's great. I've heard that updating the DNS may take some time to take effect too.

After deploying with Kamal I noticed that the proxy hadn't been modified and that caught my attention. I executed bin/kamal proxy reboot and that re created (or restarted) the docker container for the proxy and my subdomain was then working.

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay