
This post walks you through how to install ComfyUI on Ubuntu 24.04 (or a similar system), including automatic startup with systemd so the service launches on boot. It works especially well for dedicated machines, render nodes, or headless workstations.
ComfyUI is a powerful, open-source graphical interface for building and managing AI image generation workflows. It provides a node-based system, allowing users to visually connect different AI model components (like Stable Diffusion, text encoders, and upscalers) without writing code.
Built for both beginners and advanced users, ComfyUI makes it easy to customize, experiment, and automate image generation pipelines, whether you’re running it locally or on a server. Its modular design supports plugins, model management, and high-performance GPU acceleration – making it a go-to tool for creators, developers, and AI enthusiasts who want full control over their generative art process.
A machine running Ubuntu 24.04 (or a supported Ubuntu derivative).
NVIDIA GPU (e.g., RTX 3050, 3090, 5090) with drivers installed.
Basic shell familiarity and sudo privileges.
Open a terminal and run:
sudo apt update
sudo apt install git python3 python3-venv python3-dev build-essential libgl1 ssh systemd-timesyncd -y
This ensures you have the tools needed (git, Python venv support, dev-tools, etc.).
Identify the latest GPU driver for your system:
sudo ubuntu-drivers list --gpgpu
Install the recommended GPU driver + CUDA toolkit:
sudo apt update
sudo ubuntu-drivers install --gpgpu -y
sudo apt install nvidia-cuda-toolkit -y
Reboot, then verify by running:
sudo nvidia-smi
You should see your GPU info.
Pick a directory (for example ~/src) and clone the repository:
git clone https://github.com/comfyanonymous/ComfyUI.git ~/src/comfyanonymous/ComfyUI
You can use another path, but ~/src is recommended for consistency.
cd ~/src/comfyanonymous/ComfyUI
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip wheel
pip install -r requirements.txt
This creates an isolated Python environment and installs all required dependencies.
If you want better performance via GPU:
pip install torch torchvision
Check whether it’s already installed and compatible with your GPU.
To keep things organized and ready for syncing:
mkdir ~/ComfyUI
ln -s ~/src/comfyanonymous/ComfyUI/models ~/ComfyUI/models
ln -s ~/src/comfyanonymous/ComfyUI/output ~/ComfyUI/output
ln -s ~/src/comfyanonymous/ComfyUI/custom_nodes ~/ComfyUI/custom_nodes
ln -s ~/src/comfyanonymous/ComfyUI/user/default/workers ~/ComfyUI/workflows
This structure makes syncing models, outputs, and workflows across machines easy.
To test the installation:
cd ~/src/comfyanonymous/ComfyUI
source .venv/bin/activate
python3 main.py --listen 0.0.0.0
Then open your browser and navigate to http://<your-host-ip>:8188. If you’re local, use http://127.0.0.1:8188.
If you’d prefer ComfyUI to run on boot:
Create a dedicated user & group (optional but cleaner):
sudo groupadd comfyui
sudo useradd -m -g comfyui comfyui
sudo usermod -a -G comfyui $(whoami)
sudo chown -R comfyui: ~/src/comfyanonymous/ComfyUI
sudo chmod -R 775 ~/src/comfyanonymous/ComfyUI
Create a systemd service file (/etc/systemd/system/comfyui.service):
[Unit]
Description=ComfyUI Service
After=network-online.target
Wants=network-online.target
[Service]
User=comfyui
WorkingDirectory=/home/youruser/src/comfyanonymous/ComfyUI
ExecStart=/home/youruser/src/comfyanonymous/ComfyUI/.venv/bin/python3 main.py --listen 0.0.0.0
Restart=always
[Install]
WantedBy=multi-user.target
Replace /home/youruser with your real path.
Enable and start the service:
sudo systemctl daemon-reload
sudo systemctl enable comfyui
sudo systemctl start comfyui
sudo systemctl status comfyui
When running, the service will auto-start on boot, making your setup more reliable.
You now have ComfyUI installed, running manually or set to start automatically with systemd. This setup is especially useful for dedicated machines where you want a stable, always-on workflow. If you ever want to customize further (models, nodes, syncing across machines), you have a good foundation.


