How to install JupyterHub with Docker on a local machine and in a sub domain









up vote
0
down vote

favorite












I will run JupyterHub in a sub domain. Here is the Dockerfile, jupyterhub_config.py, .gitlab-ci.yml.
My first question is how to configure the jupyter_config.py. How can I load the jupyterhub_config.py on the build in the container?



How do I start Jupyterhub in the .gitlab-ci.yml for tests and how do I copy the application in the sub domain? I wrote a README.md. I need a little help for the JupyterHub. If all works fine, I will write a complete HOWTO Install JupyterHub on a local machine and in a sub domain by a provider.



FROM continuumio/miniconda3

# Updating packages
RUN apt-get update -y
&& apt-get install -y --no-install-recommends
git
nano
unzip
&& apt-get clean
&& rm -rf /var/lib/apt/lists/*

# Install conda and Jupyter
RUN conda update -y conda
RUN conda install -c conda-forge jupyter_nbextensions_configurator
jupyterhub
jupyterlab
matplotlib
pandas
scipy

# Setup application
EXPOSE 8000

CMD ["jupyterhub", "--ip='*'", "--port=8000", "--no-browser", "--allow-root"]


The .gitlab-ci.yml



image: docker:latest

variables:
CONTAINER_IMAGE: registry.gitlab.com/joklein
DOCKER_IMAGE: jupyterhub
TAG: 0.1.0

services:
- docker:dind

stages:
- build
- test
- release
- deploy

before_script:
- echo "$GITLAB_PASSWORD" | docker login registry.gitlab.com --username $GITLAB_USER --password-stdin

build:
stage: build
script:
- docker build -t $CONTAINER_IMAGE/$DOCKER_IMAGE .
- docker push $CONTAINER_IMAGE/$DOCKER_IMAGE

test:
stage: test
script:
- docker pull $CONTAINER_IMAGE/$DOCKER_IMAGE
# - docker run $CONTAINER_IMAGE/$DOCKER_IMAGE -dt -p 8000:8000 --name $DOCKER_IMAGE

release:
stage: release
script:
- docker pull $CONTAINER_IMAGE/$DOCKER_IMAGE
- docker tag $CONTAINER_IMAGE/$DOCKER_IMAGE:latest $CONTAINER_IMAGE/$DOCKER_IMAGE:$TAG
- docker push $CONTAINER_IMAGE/$DOCKER_IMAGE:$TAG
only:
- master

deploy:
stage: deploy
image: alpine:latest
before_script:
- apk update && apk add git openssh-client rsync
script:
- mkdir .public
- cp -r * .public
- mv .public public
- mkdir "$HOME/.ssh"
- echo "$SSH_HOST_KEY" > "$HOME/.ssh/known_hosts"
- echo "$SSH_PRIVATE_KEY" > "$HOME/.ssh/id_rsa"
- chmod 700 "$HOME/.ssh/id_rsa"
- rsync -hrvz --delete --exclude=_ public/ user@example.com:www/jupyter/
only:
- master


The jupyterhub_config.py



c = get_config()
# Letsencrypt (https://letsencrypt.org/) to obtain a free, trusted SSL
# certificate.
c.JupyterHub.ssl_key = '/etc/letsencrypt/live/example.com/privkey.pem'
c.JupyterHub.ssl_cert = '/etc/letsencrypt/live/example.com/fullchain.pem'
c.JupyterHub.port = 443
#
# Change from JupyterHub to JupyterLab
c.Spawner.default_url = '/lab'
c.Spawner.debug = True
#
# # Specify users and admin
c.Authenticator.whitelist = "systemuser"
c.Authenticator.admin_users = "systemuser"


Docker base image of JupyterHub and JupyterLab



JupyterHub is a multi-user server for Jupyter notebooks. JupyterLab is the
next-generation web-based user interface for the Jupyter Project. This
JupyterHub is a Docker base image for JupyterHub and JupyterLab
that works as a stand-alone application and in a (sub) domain.



Images derived from this image can either run as a stand-alone server, or
function as a volume image for your server. You can also use them in a CI/CD
system such as GitLab CI to build your content prior to bundling it into a
standalone server container.



Building your JupyterHub image



Based on this structure, you can easily build an image for your needs. There are two options for using the image you generated:



  • as a stand-alone image

  • as a volume image for your webserver

The simplest way to build your own image is to use a Dockerfile. This is only an example. If you need more software packages you can install them with this
Dockerfile and conda.



Build the container



docker build -t juypterhub .



Your JupyterHub with JupyterLab is automatically generated during this build.



Run the container



docker run -p 8000:8000 -d --name jupyterhub jupyterhub jupyterhub




  • -p is used to map your local port 8000 to the container port 8000


  • -d is used to run the container in background. JupyterHub will just write
    logs so no need to output them in your terminal unless you want to troubleshoot a server error.


  • -- name jupyterhub names your container jupyterhub


  • jupyterhub the image


  • jupyterhub is the last command used to start the jupyterhub server

and your JupyterHub with Jupyterlab is now available of http://localhost:8000.



Start / Stop JupyterHub



docker start / stop juyterhub



Configure JupyterHub



Let's encrypt certificates for JupyterHub



To enable HTTPS on your website, you need to get a certificate (a type of file) from a Certificate Authority (CA). Let’s Encrypt is a CA. In order to get a certificate for your website’s domain from Let’s Encrypt, you have to
demonstrate control over the domain. With Let’s Encrypt, you do this using
software that uses the ACME protocol, which typically runs on your web host.



Change to zerossl.com and generate a certificate for your domain. As the
result you get four files, domain-key.txt, domain-crt.txt, domain-csr.txt, account-key.txt. This files uses base 64, which is readable in
ASCII, not binary format. The certificates are already in PEM format. Just
change the extension to *.pem.



For JupyterHub only the files domain-key.txt and domain-crt are needed.



cp domain-crt.txt fullchain.pem
cp domain-key.txt privkey.pem



Add a System user in the container



By default JupyterHub searches for users on the server. In order to be able to
log in to our new JupyterHub server we need to connect to the JupyterHub docker
container and create a new system user with a password.



docker exec -it jupyterhub bash
useradd --create-home systemuser
passwd systemuser
exit



The command docker exec -it jupyterhub bash will spawn a root shell in your
docker container. You can use the root shell to create system users in the
container
. These accounts will be used for authentication in JupyterHub's
default configuration.



The first command useradd creates a new user named systemuser. The second will
ask you for a password.










share|improve this question



























    up vote
    0
    down vote

    favorite












    I will run JupyterHub in a sub domain. Here is the Dockerfile, jupyterhub_config.py, .gitlab-ci.yml.
    My first question is how to configure the jupyter_config.py. How can I load the jupyterhub_config.py on the build in the container?



    How do I start Jupyterhub in the .gitlab-ci.yml for tests and how do I copy the application in the sub domain? I wrote a README.md. I need a little help for the JupyterHub. If all works fine, I will write a complete HOWTO Install JupyterHub on a local machine and in a sub domain by a provider.



    FROM continuumio/miniconda3

    # Updating packages
    RUN apt-get update -y
    && apt-get install -y --no-install-recommends
    git
    nano
    unzip
    && apt-get clean
    && rm -rf /var/lib/apt/lists/*

    # Install conda and Jupyter
    RUN conda update -y conda
    RUN conda install -c conda-forge jupyter_nbextensions_configurator
    jupyterhub
    jupyterlab
    matplotlib
    pandas
    scipy

    # Setup application
    EXPOSE 8000

    CMD ["jupyterhub", "--ip='*'", "--port=8000", "--no-browser", "--allow-root"]


    The .gitlab-ci.yml



    image: docker:latest

    variables:
    CONTAINER_IMAGE: registry.gitlab.com/joklein
    DOCKER_IMAGE: jupyterhub
    TAG: 0.1.0

    services:
    - docker:dind

    stages:
    - build
    - test
    - release
    - deploy

    before_script:
    - echo "$GITLAB_PASSWORD" | docker login registry.gitlab.com --username $GITLAB_USER --password-stdin

    build:
    stage: build
    script:
    - docker build -t $CONTAINER_IMAGE/$DOCKER_IMAGE .
    - docker push $CONTAINER_IMAGE/$DOCKER_IMAGE

    test:
    stage: test
    script:
    - docker pull $CONTAINER_IMAGE/$DOCKER_IMAGE
    # - docker run $CONTAINER_IMAGE/$DOCKER_IMAGE -dt -p 8000:8000 --name $DOCKER_IMAGE

    release:
    stage: release
    script:
    - docker pull $CONTAINER_IMAGE/$DOCKER_IMAGE
    - docker tag $CONTAINER_IMAGE/$DOCKER_IMAGE:latest $CONTAINER_IMAGE/$DOCKER_IMAGE:$TAG
    - docker push $CONTAINER_IMAGE/$DOCKER_IMAGE:$TAG
    only:
    - master

    deploy:
    stage: deploy
    image: alpine:latest
    before_script:
    - apk update && apk add git openssh-client rsync
    script:
    - mkdir .public
    - cp -r * .public
    - mv .public public
    - mkdir "$HOME/.ssh"
    - echo "$SSH_HOST_KEY" > "$HOME/.ssh/known_hosts"
    - echo "$SSH_PRIVATE_KEY" > "$HOME/.ssh/id_rsa"
    - chmod 700 "$HOME/.ssh/id_rsa"
    - rsync -hrvz --delete --exclude=_ public/ user@example.com:www/jupyter/
    only:
    - master


    The jupyterhub_config.py



    c = get_config()
    # Letsencrypt (https://letsencrypt.org/) to obtain a free, trusted SSL
    # certificate.
    c.JupyterHub.ssl_key = '/etc/letsencrypt/live/example.com/privkey.pem'
    c.JupyterHub.ssl_cert = '/etc/letsencrypt/live/example.com/fullchain.pem'
    c.JupyterHub.port = 443
    #
    # Change from JupyterHub to JupyterLab
    c.Spawner.default_url = '/lab'
    c.Spawner.debug = True
    #
    # # Specify users and admin
    c.Authenticator.whitelist = "systemuser"
    c.Authenticator.admin_users = "systemuser"


    Docker base image of JupyterHub and JupyterLab



    JupyterHub is a multi-user server for Jupyter notebooks. JupyterLab is the
    next-generation web-based user interface for the Jupyter Project. This
    JupyterHub is a Docker base image for JupyterHub and JupyterLab
    that works as a stand-alone application and in a (sub) domain.



    Images derived from this image can either run as a stand-alone server, or
    function as a volume image for your server. You can also use them in a CI/CD
    system such as GitLab CI to build your content prior to bundling it into a
    standalone server container.



    Building your JupyterHub image



    Based on this structure, you can easily build an image for your needs. There are two options for using the image you generated:



    • as a stand-alone image

    • as a volume image for your webserver

    The simplest way to build your own image is to use a Dockerfile. This is only an example. If you need more software packages you can install them with this
    Dockerfile and conda.



    Build the container



    docker build -t juypterhub .



    Your JupyterHub with JupyterLab is automatically generated during this build.



    Run the container



    docker run -p 8000:8000 -d --name jupyterhub jupyterhub jupyterhub




    • -p is used to map your local port 8000 to the container port 8000


    • -d is used to run the container in background. JupyterHub will just write
      logs so no need to output them in your terminal unless you want to troubleshoot a server error.


    • -- name jupyterhub names your container jupyterhub


    • jupyterhub the image


    • jupyterhub is the last command used to start the jupyterhub server

    and your JupyterHub with Jupyterlab is now available of http://localhost:8000.



    Start / Stop JupyterHub



    docker start / stop juyterhub



    Configure JupyterHub



    Let's encrypt certificates for JupyterHub



    To enable HTTPS on your website, you need to get a certificate (a type of file) from a Certificate Authority (CA). Let’s Encrypt is a CA. In order to get a certificate for your website’s domain from Let’s Encrypt, you have to
    demonstrate control over the domain. With Let’s Encrypt, you do this using
    software that uses the ACME protocol, which typically runs on your web host.



    Change to zerossl.com and generate a certificate for your domain. As the
    result you get four files, domain-key.txt, domain-crt.txt, domain-csr.txt, account-key.txt. This files uses base 64, which is readable in
    ASCII, not binary format. The certificates are already in PEM format. Just
    change the extension to *.pem.



    For JupyterHub only the files domain-key.txt and domain-crt are needed.



    cp domain-crt.txt fullchain.pem
    cp domain-key.txt privkey.pem



    Add a System user in the container



    By default JupyterHub searches for users on the server. In order to be able to
    log in to our new JupyterHub server we need to connect to the JupyterHub docker
    container and create a new system user with a password.



    docker exec -it jupyterhub bash
    useradd --create-home systemuser
    passwd systemuser
    exit



    The command docker exec -it jupyterhub bash will spawn a root shell in your
    docker container. You can use the root shell to create system users in the
    container
    . These accounts will be used for authentication in JupyterHub's
    default configuration.



    The first command useradd creates a new user named systemuser. The second will
    ask you for a password.










    share|improve this question

























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I will run JupyterHub in a sub domain. Here is the Dockerfile, jupyterhub_config.py, .gitlab-ci.yml.
      My first question is how to configure the jupyter_config.py. How can I load the jupyterhub_config.py on the build in the container?



      How do I start Jupyterhub in the .gitlab-ci.yml for tests and how do I copy the application in the sub domain? I wrote a README.md. I need a little help for the JupyterHub. If all works fine, I will write a complete HOWTO Install JupyterHub on a local machine and in a sub domain by a provider.



      FROM continuumio/miniconda3

      # Updating packages
      RUN apt-get update -y
      && apt-get install -y --no-install-recommends
      git
      nano
      unzip
      && apt-get clean
      && rm -rf /var/lib/apt/lists/*

      # Install conda and Jupyter
      RUN conda update -y conda
      RUN conda install -c conda-forge jupyter_nbextensions_configurator
      jupyterhub
      jupyterlab
      matplotlib
      pandas
      scipy

      # Setup application
      EXPOSE 8000

      CMD ["jupyterhub", "--ip='*'", "--port=8000", "--no-browser", "--allow-root"]


      The .gitlab-ci.yml



      image: docker:latest

      variables:
      CONTAINER_IMAGE: registry.gitlab.com/joklein
      DOCKER_IMAGE: jupyterhub
      TAG: 0.1.0

      services:
      - docker:dind

      stages:
      - build
      - test
      - release
      - deploy

      before_script:
      - echo "$GITLAB_PASSWORD" | docker login registry.gitlab.com --username $GITLAB_USER --password-stdin

      build:
      stage: build
      script:
      - docker build -t $CONTAINER_IMAGE/$DOCKER_IMAGE .
      - docker push $CONTAINER_IMAGE/$DOCKER_IMAGE

      test:
      stage: test
      script:
      - docker pull $CONTAINER_IMAGE/$DOCKER_IMAGE
      # - docker run $CONTAINER_IMAGE/$DOCKER_IMAGE -dt -p 8000:8000 --name $DOCKER_IMAGE

      release:
      stage: release
      script:
      - docker pull $CONTAINER_IMAGE/$DOCKER_IMAGE
      - docker tag $CONTAINER_IMAGE/$DOCKER_IMAGE:latest $CONTAINER_IMAGE/$DOCKER_IMAGE:$TAG
      - docker push $CONTAINER_IMAGE/$DOCKER_IMAGE:$TAG
      only:
      - master

      deploy:
      stage: deploy
      image: alpine:latest
      before_script:
      - apk update && apk add git openssh-client rsync
      script:
      - mkdir .public
      - cp -r * .public
      - mv .public public
      - mkdir "$HOME/.ssh"
      - echo "$SSH_HOST_KEY" > "$HOME/.ssh/known_hosts"
      - echo "$SSH_PRIVATE_KEY" > "$HOME/.ssh/id_rsa"
      - chmod 700 "$HOME/.ssh/id_rsa"
      - rsync -hrvz --delete --exclude=_ public/ user@example.com:www/jupyter/
      only:
      - master


      The jupyterhub_config.py



      c = get_config()
      # Letsencrypt (https://letsencrypt.org/) to obtain a free, trusted SSL
      # certificate.
      c.JupyterHub.ssl_key = '/etc/letsencrypt/live/example.com/privkey.pem'
      c.JupyterHub.ssl_cert = '/etc/letsencrypt/live/example.com/fullchain.pem'
      c.JupyterHub.port = 443
      #
      # Change from JupyterHub to JupyterLab
      c.Spawner.default_url = '/lab'
      c.Spawner.debug = True
      #
      # # Specify users and admin
      c.Authenticator.whitelist = "systemuser"
      c.Authenticator.admin_users = "systemuser"


      Docker base image of JupyterHub and JupyterLab



      JupyterHub is a multi-user server for Jupyter notebooks. JupyterLab is the
      next-generation web-based user interface for the Jupyter Project. This
      JupyterHub is a Docker base image for JupyterHub and JupyterLab
      that works as a stand-alone application and in a (sub) domain.



      Images derived from this image can either run as a stand-alone server, or
      function as a volume image for your server. You can also use them in a CI/CD
      system such as GitLab CI to build your content prior to bundling it into a
      standalone server container.



      Building your JupyterHub image



      Based on this structure, you can easily build an image for your needs. There are two options for using the image you generated:



      • as a stand-alone image

      • as a volume image for your webserver

      The simplest way to build your own image is to use a Dockerfile. This is only an example. If you need more software packages you can install them with this
      Dockerfile and conda.



      Build the container



      docker build -t juypterhub .



      Your JupyterHub with JupyterLab is automatically generated during this build.



      Run the container



      docker run -p 8000:8000 -d --name jupyterhub jupyterhub jupyterhub




      • -p is used to map your local port 8000 to the container port 8000


      • -d is used to run the container in background. JupyterHub will just write
        logs so no need to output them in your terminal unless you want to troubleshoot a server error.


      • -- name jupyterhub names your container jupyterhub


      • jupyterhub the image


      • jupyterhub is the last command used to start the jupyterhub server

      and your JupyterHub with Jupyterlab is now available of http://localhost:8000.



      Start / Stop JupyterHub



      docker start / stop juyterhub



      Configure JupyterHub



      Let's encrypt certificates for JupyterHub



      To enable HTTPS on your website, you need to get a certificate (a type of file) from a Certificate Authority (CA). Let’s Encrypt is a CA. In order to get a certificate for your website’s domain from Let’s Encrypt, you have to
      demonstrate control over the domain. With Let’s Encrypt, you do this using
      software that uses the ACME protocol, which typically runs on your web host.



      Change to zerossl.com and generate a certificate for your domain. As the
      result you get four files, domain-key.txt, domain-crt.txt, domain-csr.txt, account-key.txt. This files uses base 64, which is readable in
      ASCII, not binary format. The certificates are already in PEM format. Just
      change the extension to *.pem.



      For JupyterHub only the files domain-key.txt and domain-crt are needed.



      cp domain-crt.txt fullchain.pem
      cp domain-key.txt privkey.pem



      Add a System user in the container



      By default JupyterHub searches for users on the server. In order to be able to
      log in to our new JupyterHub server we need to connect to the JupyterHub docker
      container and create a new system user with a password.



      docker exec -it jupyterhub bash
      useradd --create-home systemuser
      passwd systemuser
      exit



      The command docker exec -it jupyterhub bash will spawn a root shell in your
      docker container. You can use the root shell to create system users in the
      container
      . These accounts will be used for authentication in JupyterHub's
      default configuration.



      The first command useradd creates a new user named systemuser. The second will
      ask you for a password.










      share|improve this question















      I will run JupyterHub in a sub domain. Here is the Dockerfile, jupyterhub_config.py, .gitlab-ci.yml.
      My first question is how to configure the jupyter_config.py. How can I load the jupyterhub_config.py on the build in the container?



      How do I start Jupyterhub in the .gitlab-ci.yml for tests and how do I copy the application in the sub domain? I wrote a README.md. I need a little help for the JupyterHub. If all works fine, I will write a complete HOWTO Install JupyterHub on a local machine and in a sub domain by a provider.



      FROM continuumio/miniconda3

      # Updating packages
      RUN apt-get update -y
      && apt-get install -y --no-install-recommends
      git
      nano
      unzip
      && apt-get clean
      && rm -rf /var/lib/apt/lists/*

      # Install conda and Jupyter
      RUN conda update -y conda
      RUN conda install -c conda-forge jupyter_nbextensions_configurator
      jupyterhub
      jupyterlab
      matplotlib
      pandas
      scipy

      # Setup application
      EXPOSE 8000

      CMD ["jupyterhub", "--ip='*'", "--port=8000", "--no-browser", "--allow-root"]


      The .gitlab-ci.yml



      image: docker:latest

      variables:
      CONTAINER_IMAGE: registry.gitlab.com/joklein
      DOCKER_IMAGE: jupyterhub
      TAG: 0.1.0

      services:
      - docker:dind

      stages:
      - build
      - test
      - release
      - deploy

      before_script:
      - echo "$GITLAB_PASSWORD" | docker login registry.gitlab.com --username $GITLAB_USER --password-stdin

      build:
      stage: build
      script:
      - docker build -t $CONTAINER_IMAGE/$DOCKER_IMAGE .
      - docker push $CONTAINER_IMAGE/$DOCKER_IMAGE

      test:
      stage: test
      script:
      - docker pull $CONTAINER_IMAGE/$DOCKER_IMAGE
      # - docker run $CONTAINER_IMAGE/$DOCKER_IMAGE -dt -p 8000:8000 --name $DOCKER_IMAGE

      release:
      stage: release
      script:
      - docker pull $CONTAINER_IMAGE/$DOCKER_IMAGE
      - docker tag $CONTAINER_IMAGE/$DOCKER_IMAGE:latest $CONTAINER_IMAGE/$DOCKER_IMAGE:$TAG
      - docker push $CONTAINER_IMAGE/$DOCKER_IMAGE:$TAG
      only:
      - master

      deploy:
      stage: deploy
      image: alpine:latest
      before_script:
      - apk update && apk add git openssh-client rsync
      script:
      - mkdir .public
      - cp -r * .public
      - mv .public public
      - mkdir "$HOME/.ssh"
      - echo "$SSH_HOST_KEY" > "$HOME/.ssh/known_hosts"
      - echo "$SSH_PRIVATE_KEY" > "$HOME/.ssh/id_rsa"
      - chmod 700 "$HOME/.ssh/id_rsa"
      - rsync -hrvz --delete --exclude=_ public/ user@example.com:www/jupyter/
      only:
      - master


      The jupyterhub_config.py



      c = get_config()
      # Letsencrypt (https://letsencrypt.org/) to obtain a free, trusted SSL
      # certificate.
      c.JupyterHub.ssl_key = '/etc/letsencrypt/live/example.com/privkey.pem'
      c.JupyterHub.ssl_cert = '/etc/letsencrypt/live/example.com/fullchain.pem'
      c.JupyterHub.port = 443
      #
      # Change from JupyterHub to JupyterLab
      c.Spawner.default_url = '/lab'
      c.Spawner.debug = True
      #
      # # Specify users and admin
      c.Authenticator.whitelist = "systemuser"
      c.Authenticator.admin_users = "systemuser"


      Docker base image of JupyterHub and JupyterLab



      JupyterHub is a multi-user server for Jupyter notebooks. JupyterLab is the
      next-generation web-based user interface for the Jupyter Project. This
      JupyterHub is a Docker base image for JupyterHub and JupyterLab
      that works as a stand-alone application and in a (sub) domain.



      Images derived from this image can either run as a stand-alone server, or
      function as a volume image for your server. You can also use them in a CI/CD
      system such as GitLab CI to build your content prior to bundling it into a
      standalone server container.



      Building your JupyterHub image



      Based on this structure, you can easily build an image for your needs. There are two options for using the image you generated:



      • as a stand-alone image

      • as a volume image for your webserver

      The simplest way to build your own image is to use a Dockerfile. This is only an example. If you need more software packages you can install them with this
      Dockerfile and conda.



      Build the container



      docker build -t juypterhub .



      Your JupyterHub with JupyterLab is automatically generated during this build.



      Run the container



      docker run -p 8000:8000 -d --name jupyterhub jupyterhub jupyterhub




      • -p is used to map your local port 8000 to the container port 8000


      • -d is used to run the container in background. JupyterHub will just write
        logs so no need to output them in your terminal unless you want to troubleshoot a server error.


      • -- name jupyterhub names your container jupyterhub


      • jupyterhub the image


      • jupyterhub is the last command used to start the jupyterhub server

      and your JupyterHub with Jupyterlab is now available of http://localhost:8000.



      Start / Stop JupyterHub



      docker start / stop juyterhub



      Configure JupyterHub



      Let's encrypt certificates for JupyterHub



      To enable HTTPS on your website, you need to get a certificate (a type of file) from a Certificate Authority (CA). Let’s Encrypt is a CA. In order to get a certificate for your website’s domain from Let’s Encrypt, you have to
      demonstrate control over the domain. With Let’s Encrypt, you do this using
      software that uses the ACME protocol, which typically runs on your web host.



      Change to zerossl.com and generate a certificate for your domain. As the
      result you get four files, domain-key.txt, domain-crt.txt, domain-csr.txt, account-key.txt. This files uses base 64, which is readable in
      ASCII, not binary format. The certificates are already in PEM format. Just
      change the extension to *.pem.



      For JupyterHub only the files domain-key.txt and domain-crt are needed.



      cp domain-crt.txt fullchain.pem
      cp domain-key.txt privkey.pem



      Add a System user in the container



      By default JupyterHub searches for users on the server. In order to be able to
      log in to our new JupyterHub server we need to connect to the JupyterHub docker
      container and create a new system user with a password.



      docker exec -it jupyterhub bash
      useradd --create-home systemuser
      passwd systemuser
      exit



      The command docker exec -it jupyterhub bash will spawn a root shell in your
      docker container. You can use the root shell to create system users in the
      container
      . These accounts will be used for authentication in JupyterHub's
      default configuration.



      The first command useradd creates a new user named systemuser. The second will
      ask you for a password.







      jupyter-notebook jupyter-lab jupyterhub jupyter-console






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 8 at 20:19

























      asked Nov 8 at 19:41









      joerg

      116212




      116212



























          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53215010%2fhow-to-install-jupyterhub-with-docker-on-a-local-machine-and-in-a-sub-domain%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53215010%2fhow-to-install-jupyterhub-with-docker-on-a-local-machine-and-in-a-sub-domain%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

          How do I collapse sections of code in Visual Studio Code for Windows?

          Node.js puppeteer - Use values from array in a loop to cycle through pages