Setting up Domain
You can access your self-hosted version of DronaHQ from your own domain. This makes your self-hosted version accessible from anywhere just by searching the domain associated with it. Setting up a custom domain for the self-hosted version is very easy. Make sure that the Self-hosted version of DronaHQ is already activated in your system. You can refer to this article for for Activating Self-Hosted DronaHq.
Follow these steps, once the self-hosted version is activated and running in your system.
-
Open up the terminal and go to the Self-Hosted folder.
cd dronahq/self-hosted
-
There will be an nginx.conf file in which we have to make changes.
nano nginx.conf
-
The nano text editor will open and replace server_name dronahq with your_domain. Then save the changes.
NOTE: Do not include HTTP or HTTPS.
-
Next, we have to restart the webserver.
sudo docker-compose restart webserver
NOTE: Make sure that the domain you are adding has been mapped to your machine IP address from the domain service provider itself, in order to get requests on the self-hosted version’s domain.
-
Now we have to edit the dronahq.env file where we have to edit the domain name from localhost:8080 to your_custom_domain.
-
Finally, you just have to restart the web app.
sudo docker-compose restart webapp
After completing these steps, your self-hosted version of DronaHQ has been set up to be accessed by the provided custom domain.
Adding SSL to the Domain
Adding SSL to your domain makes it more secure to transfer files as well as prevents online attacks and for your domain of the Self-Hosted version of DronaHQ, you can add an SSL certificate very easily by following a few steps.
Using Self-Signed Certificate
Docker makes it very easy to generate certificates and while activating the Self-hosted version, all the necessary Docker files are already been downloaded into your system.
-
Open up the terminal and go to the dronahq/self_hosted directory and run the following code.
sudo docker-compose -f certbot-docker-compose.yml run --rm certbot certonly --webroot --webroot-path /var/www/certbot/ --force-renewal --email <your_email_id> -d <your_custom_domain> --agree-tos --non-interactive
After running the above code, it will generate an SSL certificate in your system.
Follow Step 1 only in case renewing certificate.
-
Next you have to copy the content of the downloaded certificate that is nginx-ssl-default.conf to nginx.conf.
cp init/nginx-ssl-default.conf nginx.conf
-
Now make changes in nginx.conf file.
nano nginx.conf
We have to provide the custom domain and uncomment two lines and then save it.
After edit
-
Next, we have to restart the webserver.
sudo docker-composer restart webserver
-
Now we have to edit the dronahq.env file where we have to edit http to https. It will already have your custom domain.
-
Finallweb app just have to restart the web app.
sudo docker-compose restart webapp
After completing these steps, your domain of the self-hosted version of DronaHQ will have an SSL certificate installed.
In the above image, you can see that we have provided a custom domain for the self-hosted version of DronaHQ along with an SSL certificate installed for the domain.