{"id":275,"date":"2025-08-04T08:35:15","date_gmt":"2025-08-04T08:35:15","guid":{"rendered":"https:\/\/blog.hostinger.io\/support\/2025\/08\/04\/11927159-changing-the-domain-for-n8n-on-vps-at-hostinger\/"},"modified":"2026-08-06T06:15:41","modified_gmt":"2026-08-06T06:15:41","slug":"11927159-changing-the-domain-for-n8n-on-vps-at-hostinger","status":"publish","type":"post","link":"https:\/\/www.hostinger.com\/support\/11927159-changing-the-domain-for-n8n-on-vps-at-hostinger\/","title":{"rendered":"Changing the domain for n8n on VPS at Hostinger"},"content":{"rendered":"
Change the default domain for n8n on VPS at Hostinger to use your own domain or subdomain instead of the default srvXXXXX.hstgr.cloud address.<\/p>
You can update the configuration by following these steps:<\/p>
Access your VPS through a web console:<\/p>\n
<\/p>\n
Navigate to the container directory (replace [container-name] with your actual container’s name):<\/p>\n
cd \/docker\/[container-name]<\/pre>\n<\/div>\n<\/div>\n<\/li>\n
Edit the environment configuration file by running:<\/p>\n
nano .env<\/code><\/pre>\n<\/li>\n- Locate the TRAEFIK_HOST value and replace it with your own domain or subdomain that points to your VPS (e.g., sub.domain.com).<\/li>\n
- Save the file by pressing Ctrl+X, then Y, and Enter.<\/li>\n
- Open the docker-compose.yml file and make two changes:\n
\n- Change 1 — Fix the WEBHOOK_URL:\n
# Before\r\n- WEBHOOK_URL=https:\/\/${COMPOSE_PROJECT_NAME}.${TRAEFIK_HOST}\/\r\n\r\n# After\r\n- WEBHOOK_URL=https:\/\/${TRAEFIK_HOST}\/<\/pre>\n<\/li>\n - Change 2 — Fix the Traefik router rule:\n
# Before\r\n- traefik.http.routers.${COMPOSE_PROJECT_NAME}.rule=Host(`${COMPOSE_PROJECT_NAME}.${TRAEFIK_HOST}`)\r\n\r\n# After\r\n- traefik.http.routers.${COMPOSE_PROJECT_NAME}.rule=Host(`${TRAEFIK_HOST}`)<\/pre>\n
<\/p><\/li>\n<\/ul>\n<\/li>\n
- \n
Restart the n8n service to apply the changes:<\/pre>\ndocker compose down\r\ndocker compose up -d<\/code><\/pre>\n<\/li>\n<\/ol>Once restarted, you should be able to access n8n via your custom domain. Make sure DNS propagation is complete before testing the new address.<\/p>
\n<\/p>\n","protected":false},"excerpt":{"rendered":"
How to change default domain for n8n VPS?<\/p>\n","protected":false},"author":581,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"include_on_kodee":true,"footnotes":""},"categories":[199],"tags":[],"class_list":["post-275","post","type-post","status-publish","format-standard","hentry","category-vps-management"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/support\/11927159-changing-the-domain-for-n8n-on-vps-at-hostinger","default":1}],"include_on_kodee":true,"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/275","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/users\/581"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/comments?post=275"}],"version-history":[{"count":7,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/275\/revisions"}],"predecessor-version":[{"id":14650,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/275\/revisions\/14650"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/media?parent=275"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/categories?post=275"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/tags?post=275"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}