This article explains how to serve your Hossted-deployed application from your own domain.
It is important to note that applications differ in their levels of domain sensitivity. For some applications, it is sufficient to configure Traefik settings, while for others, an additional change in the application itself might be required.
For the scope of this tutorial, we will cover the steps needed for those applications where configuring Traefik settings is sufficient.
For additional support, our experienced DevOps can be reached here.
The tutorial contains 4 sections:
Pointing your Domain Name to the VM’s IP address.
Accessing and Editing the App’s .env File.
Restarting the Traefik proxy
Accessing your Host Name.
1. Pointing your Domain Name to the VM’s IP address.
1.1. In your DNS management UI, update your DNS settings to point to the IP address of your VM.
1.2. Note that shutting down and restarting your VM will change the IP address.
2. Accessing and Editing the App’s .env File.
2.1. Log in by SSH. You can find more details on SSH login here
2.3. Go to the app’s home by typing:
2.4. Locate and edit the .env file.
2.5. Save your string as PROJECT_BASE_URL.
2.6. Point it to the domain you have chosen your app to answer on.
3. Restarting the Traefik Proxy
Restarting the Traefik Proxy is necessary after updating the .env file.
To do so:
docker-compose stop traefik
docker-compose up -d
4. Accessing your Custom Domain
4.1. Wait 15-20 seconds, then attempt to access your new custom domain
4.2. The application should appear in its new location. An SSL certificate will be re-requested for your domain.
Would you prefer us to do it for you, or together with you? Contact Hossted’s expert DevOps team for one-on-one assistance, here.