Skip to content

Custom DNS

By default JupyterHub will be available at the public IP address of the instance.

To set a custom DNS, e.g., as the access point:

  1. In AWS configure a Elastic IP address to the EC2 instance
  2. Add a DNS A record from the subdomain to the Elastic IP
  3. On the EC2 instance create a /opt/jupyterhub/config/jupyterhub_dns file and write the DNS
  1. Execute the /usr/local/bin/ script.
$ /usr/local/bin/

Now you should be able to access and login as usual.


If you are planning to use HTTPS you need to enable it for the JupyterHub service:

  1. Create a file name: /opt/jupyterhub/config/jupyterhub_https
touch /opt/jupyterhub/config/jupyterhub_https
  1. Restart the JuptyerHub service:
$ /usr/local/bin/

Additionally and depending on the desired DNS configuration you might need to configure SSL termination on the EC2 instance, see SSL.

You can also relax this options on the DNS services. For example on CloudFlare:

  • The Flexible option encrypts traffic only between the browser and Cloudflare. So you don't need to enable SSL on the EC2 instance.
  • The Full and Full (strict) configurations requires to configure SSL on the EC2 instance