{"id":16221919,"url":"https://github.com/mirsazzathossain/dockerized-jupyter","last_synced_at":"2026-04-29T12:33:21.357Z","repository":{"id":155074348,"uuid":"604392328","full_name":"mirsazzathossain/dockerized-jupyter","owner":"mirsazzathossain","description":"This repo 📚 contains a `docker-compose.yml` file for running a Jupyter notebook 📓 server in a Docker container 🐳. Easily save your notebooks and conda environments 🐍 to your local machine for simple access and restoration. Say goodbye to dependency issues and installation  headaches 🤕 and start using Jupyter now! 🚀","archived":false,"fork":false,"pushed_at":"2023-02-24T18:42:52.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-08T00:46:00.798Z","etag":null,"topics":["anaconda-environment","conda-environment","docker","docker-compose","docker-container","docker-image","docker-jupyter","docker-jupyter-env","dockerfile","jupyter","jupyter-client","jupyter-docker","jupyter-kernels","jupyter-notebook","jupyter-server","jupyterlab"],"latest_commit_sha":null,"homepage":"https://www.mirsazzathossain.me/articles/dockerizing-jupyter-notebook","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mirsazzathossain.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-21T00:52:07.000Z","updated_at":"2023-03-08T19:07:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"0037e470-6f87-4878-b9e5-c611241ff5c1","html_url":"https://github.com/mirsazzathossain/dockerized-jupyter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mirsazzathossain/dockerized-jupyter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirsazzathossain%2Fdockerized-jupyter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirsazzathossain%2Fdockerized-jupyter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirsazzathossain%2Fdockerized-jupyter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirsazzathossain%2Fdockerized-jupyter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mirsazzathossain","download_url":"https://codeload.github.com/mirsazzathossain/dockerized-jupyter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirsazzathossain%2Fdockerized-jupyter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32426578,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T12:24:25.982Z","status":"ssl_error","status_checked_at":"2026-04-29T12:24:24.439Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anaconda-environment","conda-environment","docker","docker-compose","docker-container","docker-image","docker-jupyter","docker-jupyter-env","dockerfile","jupyter","jupyter-client","jupyter-docker","jupyter-kernels","jupyter-notebook","jupyter-server","jupyterlab"],"created_at":"2024-10-10T12:10:26.263Z","updated_at":"2026-04-29T12:33:21.324Z","avatar_url":"https://github.com/mirsazzathossain.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dockerized Jupyter\n\n![Dockerized Jupyter](https://repository-images.githubusercontent.com/604392328/b14e7ed1-3cf0-4bf1-a33c-ac04da99f3d0)\n\nThis repository provides a `docker-compose.yml` file, based on the [jupyter/minimal-notebook](https://hub.docker.com/r/jupyter/minimal-notebook/) image, which is a minimal Jupyter notebook server. With Docker, you can easily set up a Jupyter Notebook environment without worrying about dependencies or affecting your local machine. The environment is self-contained and can be easily destroyed when you're done. It comes with an installed conda environment and you can install additional packages as needed, creating new environments for different projects. Additionally, the container is configured to automatically save your notebooks to a directory on your local machine, allowing for easy access outside of the container. All the Conda environments are also saved locally, making it easy to restore them if anything happens to the container. This repository is a great starting point for anyone looking to explore Jupyter and Docker.\n\n## Pre-requisites\n\n- [Docker](https://docs.docker.com/install/): Make sure you have Docker installed on your machine. Download and install guide can be found [here](https://docs.docker.com/install/).\n- [Docker Compose](https://docs.docker.com/compose/install/): Make sure Docker Compose is also installed on your local machine. Docker Compose is included with Docker Desktop for Windows and macOS, but Linux users may need to install it separately. You can download Docker Compose from the [official website](https://docs.docker.com/compose/install/).\n\n## Installation\n\n1. Clone this repository to your local machine:\n\n   ```bash\n   git clone https://github.com/mirsazzathossain/dockerized-jupyter.git\n   # or\n   git clone git@github.com:mirsazzathossain/dockerized-jupyter.git\n   ```\n\n2. Change directory to the cloned repository:\n\n   ```bash\n    cd dockerized-jupyter\n   ```\n\n3. Create a `.env` file for environment variables:\n\n   ```bash\n   touch .env\n   ```\n\n4. Add the following environment variables to the `.env` file:\n\n   ```yaml\n   JUPYTER_TOKEN=your-jupyter-token\n   PASSWORD_HASH=your-password-hash\n   NOTEBOOK_USER=your-notebook-user\n   ```\n\n   Set a random string for `JUPYTER_TOKEN` which will be used to access the Jupyter Notebook server. You can generate a `PASSWORD_HASH` using the following command:\n\n   ```bash\n   python -c \"from notebook.auth import passwd; print(passwd(passphrase='your-password', algorithm='sha1'))\"\n   ```\n\n   This will generate a `PASSWORD_HASH` for the password `your-password`. When you run the command, you will see an output similar to the following:\n\n   ```bash\n   sha1:your-password-hash\n   ```\n\n   Copy the `PASSWORD_HASH` and paste it in the `.env` file. Set a username for `NOTEBOOK_USER` which will be used as the username in the Jupyter Notebook server.\n\n5. Build the Docker container:\n\n   ```bash\n   docker compose up -d\n   ```\n\n6. Navigate to `http://localhost:8888` or `https://\u003cyour-public-ip\u003e:8888` in your browser. You will be prompted to enter the `JUPYTER_TOKEN` you set in the `.env` file. Once you enter the token, you will be able to access the Jupyter Notebook server.\n\n## Modifying the Configuration\n\nIf you need to modify the configuration of the Docker container, you can do so by editing the `docker-compose.yml` file. However, keep in mind that any changes you make to this file will not take effect until you restart the Docker container.\n\n## Using conda in Jupyter Lab\n\nYou can create a new conda environment using the following command in the Jupyter Notebook terminal:\n\n```bash\nconda create --name myenv python=3.x\n```\n\nYou can activate the environment using the following command:\n\n```bash\nconda activate myenv\n```\n\nTo install packages in the environment, use the following command:\n\n```bash\nconda install -c conda-forge \u003cpackage-name\u003e\n```\n\nTo deactivate the environment, use the following command:\n\n```bash\nconda deactivate\n```\n\n## Using conda environments as kernels in Jupyter\n\nYou can use the conda environments as kernels in Jupyter. To do so, first activate the environment you want to use as a kernel. Then, run the following command to install `ipykernel`:\n\n```bash\nconda install -c anaconda ipykernel\n```\n\nOnce the installation is complete, run the following command to register the environment as a kernel:\n\n```bash\npython -m ipykernel install --user --name myenv --display-name \"Python (myenv)\"\n```\n\nRestart the Jupyter Notebook kernel and you will see the new kernel in the kernel list. You can now use the environment as a kernel in Jupyter.\n\n## Saving and restoring conda environments\n\nYou can save the conda environment to a file using the following command:\n\n```bash\nconda env export \u003e environments/myenv.yml\n```\n\nIf any thigs happen to the container, the conda environments will be saved in the `environments` directory on your local machine. Once you have the container up and running again, all the environments will be restored automatically.\n\n## Contributing\n\nIf you have any suggestions or improvements, feel free to open an issue or submit a pull request. If you find this repository useful, please consider giving it a star.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. Feel free to use this code in your projects, but please don't copy-paste it. Try to understand what it does and write it yourself. This will help you learn and understand the code better. You can read my blog post titled [\"Dockerize Your Data Science Workflow: A Step-by-Step Guide to Setting Up Jupyter Lab on Your Private Linux Machine\"](https://www.mirsazzathossain.me/articles/dockerizing-jupyter-notebook) for more details. If you do use it, a mention would be appreciated, but is not required. Thanks! :heart: [↩](#dockerized-jupyter)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmirsazzathossain%2Fdockerized-jupyter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmirsazzathossain%2Fdockerized-jupyter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmirsazzathossain%2Fdockerized-jupyter/lists"}