PyCharm Docker: CPU Image or GPU-Ready Data Science with TensorFlow and Jupyter Notebook
100K+
This Docker container provides a quick and easy way to run or try PyCharm Community Edition. It supports both CPU and GPU configurations, with optional integrations for TensorFlow and Jupyter Notebook. The source code for this project is available on the GitLab repository.
This README is designed to be accessible for both junior and expert users. Beginners will find step-by-step instructions with explanations, while experts can skim sections or jump directly to advanced topics. Important Note: Always refer to the official documentation for the most up-to-date instructions. We provide summaries here for convenience, but visit the respective official websites (linked throughout) for complete details and troubleshooting.
We offer two main image variants:
CPU images built after March 2023 are based on Ubuntu 22.04 LTS. CPU images built after July 2025 are based on Ubuntu 24.04 LTS (tags now include the Ubuntu version for clarity). GPU images are based on the official TensorFlow Docker image's base OS, which is Ubuntu 22.04 LTS for TensorFlow 2.19.0.
:cpu-<ubuntu_version>-<pycharm_version> (e.g., :cpu-24.04-2025.1.3.1). Only PyCharm is pre-installed.:gpu-<tensorflow_version>-jupyter-<pycharm_version> (e.g., :gpu-2.19.0-jupyter-2025.1.3.1). Includes PyCharm, TensorFlow, and Jupyter Notebook.:cpu for the latest CPU image or :gpu for the latest GPU image. Deprecated tags like -devel, -custom-op, and -latest are no longer supported.All images use Python 3 exclusively (version varies: 3.8 for CPU on Ubuntu 22.04, 3.12 for CPU on Ubuntu 24.04, and 3.11 for GPU based on TensorFlow's official image).
Back to Table of Contents.
GPU Tags: Based on TensorFlow's official Docker images and NVIDIA CUDA. Requires NVIDIA Docker for GPU support. Note: For TensorFlow 1.13+ (including latest tags), ensure your NVIDIA driver supports CUDA 10 or later—check the NVIDIA CUDA compatibility matrix.
These images include a Jupyter Notebook server and sample TensorFlow tutorials. The container starts Jupyter by default. To persist notebooks, mount a volume to /tf/notebooks (see examples below).
Alternatively, launch PyCharm on boot and start Jupyter manually from a PyCharm terminal (instructions provided later).
To run GPU-accelerated containers, install the NVIDIA Container Toolkit on your host system (e.g., Ubuntu 24.04). This enables Docker to access your NVIDIA GPU.
Add the NVIDIA Container Toolkit Repository:
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg
curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
Update and Install:
sudo apt-get update
sudo apt-get install -y nvidia-container-toolkit
Configure Docker:
sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart docker
Verify Installation: Run a test container to confirm GPU access:
docker run --rm --gpus all nvidia/cuda:12.0.0-base-ubuntu22.04 nvidia-smi
This should display your GPU details.
For more details, see the NVIDIA Container Toolkit Installation Guide.
Back to Table of Contents.
Docker Engine is required to run these containers. Important Note: For the most accurate and current installation steps, visit the official Docker Engine installation guide. The instructions below are for Ubuntu and are summaries—follow the official docs for your OS.
There are two common Docker packages: docker.io (from Ubuntu repositories) and docker-ce (from Docker, Inc.).
sudo apt-get update
sudo apt-get install docker.io
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg lsb-release
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
After installation:
docker group: sudo usermod -aG docker $USER.newgrp docker) for changes to take effect.id to check group membership, then docker stats to test.If issues arise, consult the official Docker Engine documentation.
Back to Table of Contents.
These commands run containers temporarily for testing—data is lost on exit. For persistent setups, use Docker Compose (see below).
docker run -it --rm \
-e DISPLAY=unix$DISPLAY \
-v /tmp/.X11-unix:/tmp/.X11-unix \
tkopen/pycharm:cpu pycharm
docker run -it --rm --gpus all \
-e DISPLAY=unix$DISPLAY \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-p 8888:8888 \
tkopen/pycharm:gpu pycharm
To start Jupyter from a PyCharm terminal:
jupyter notebook --notebook-dir=/home/coder --ip 0.0.0.0 --no-browser --allow-root
Access at http://localhost:8888 (token shown in terminal).
For persistent notebooks (GPU example):
docker run -it --rm --gpus all \
-e DISPLAY=unix$DISPLAY \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v $HOME/my_notebooks:/tf/notebooks \
-p 8888:8888 \
tkopen/pycharm:gpu
Without volumes, PyCharm settings, code, and data are lost. Key directories to persist:
/home/coder/.cache/home/coder/.java/home/coder/.config/JetBrains/home/coder/.local/share/JetBrains/home/coder/workspaceUse volumes in commands or Docker Compose for persistence.
Back to Table of Contents.
Docker Compose simplifies managing containers, volumes, and networks via a YAML file. Important Note: Visit the official Docker Compose installation guide for the latest steps.
Installation (Ubuntu):
sudo apt-get update
sudo apt-get install docker-compose-plugin
Verify: docker compose version.
For usage details, see the official Docker Compose documentation.
Download docker-compose.yml from the GitLab repository.
Run CPU container:
docker compose -f ~/path/to/docker-compose.yml up pycharm
Run GPU container:
docker compose -f ~/path/to/docker-compose.yml up pycharm-gpu
On first launch, PyCharm prompts to create/open a project. Select "Open" and point to /home/coder/workspace.


Back to Table of Contents.
/usr/bin/python3) as "externally managed" to prevent global installs that could conflict with OS packages. This causes errors like error: externally-managed-environment if you run python3 -m pip install <package> without a virtual environment. A venv is pre-created at ~/.local/venv, with its bin added to PATH in ~/.profile. To fix:
source ~/.profile to update PATH, then python3 -m pip install <package>.source ~/.local/venv/bin/activate for direct pip install <package>.which python3 (should show ~/.local/venv/bin/python3)./bin/bash -l in Settings.-d: docker compose -f ~/path/to/docker-compose.yml up -d pycharm. Stop with docker compose -f ~/path/to/docker-compose.yml down.docker login. Sign up for a free account at hub.docker.com.xhost +local:docker to allow Docker to access your display.http://127.0.0.1:8888/?token=abc123). Copy the token and paste it into your browser to log in.docker ps to see running containers or docker ps -a to see all containers (including stopped ones).ports: ["8888:8888"].docker-compose.yml (e.g., deploy: resources: limits: cpus: "2" memory: "4g") to optimize performance.nvidia-smi and ensure the NVIDIA Container Toolkit is installed (sudo apt-get install nvidia-container-toolkit).:cpu or :gpu tags for production to prevent unexpected updates. Use specific tags (e.g., :cpu-24.04-2025.1.3.1).docker system prune or docker volume prune to save disk space.Back to Table of Contents.
Create an issue on the GitLab project issues page.
Back to Table of Contents.
Contributions are welcome to enhance usability across OSes. Submit merge requests via GitLab.
Back to Table of Contents.
Back to Table of Contents.
Content type
Image
Digest
sha256:29837719e…
Size
5.8 GB
Last updated
about 1 month ago
docker pull tkopen/pycharm:gpu