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. jupyterhub.domain.com, 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
/opt/jupyterhub/config/jupyterhub_dns
jupyterhub.domain.com
  1. Execute the /usr/local/bin/jupyterhub-boot.sh script.
Terminal
$ /usr/local/bin/jupyterhub-boot.sh

Now you should be able to access http://jupyterhub.domain.com and login as usual.

SSL

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
Terminal
touch /opt/jupyterhub/config/jupyterhub_https
  1. Restart the JuptyerHub service:
Terminal
$ /usr/local/bin/jupyterhub-boot.sh

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