ai-stack/UBUNTU-INSTALL.md
Press Ctrl + Alt + T to open Terminal
docker --version
If you see a version number, skip to Step 2. Otherwise, continue:
Copy and paste these commands one at a time:
# Update package list
sudo apt update
# Install required packages
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
# Add Docker's official GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
# Add Docker repository
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
# Update package list again
sudo apt update
# Install Docker
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
# Add your user to docker group (so you don't need sudo)
sudo usermod -aG docker $USER
# Apply the new group membership
newgrp docker
docker --version
docker compose version
You should see version numbers for both.
# Install git if you don't have it
sudo apt install -y git
# Clone the repository
git clone https://github.com/insomniakin/n8n-workflows.git
# Go to the ai-stack folder
cd n8n-workflows/ai-stack
# Install wget and unzip if you don't have them
sudo apt install -y wget unzip
# Download the repository
wget https://github.com/insomniakin/n8n-workflows/archive/refs/heads/feature/ai-automation-stack.zip
# Unzip it
unzip feature/ai-automation-stack.zip
# Go to the ai-stack folder
cd n8n-workflows-feature-ai-automation-stack/ai-stack
chmod +x start.sh
./start.sh
The script will:
š AI Stack is running!
Open your web browser (Firefox, Chrome, etc.) and go to:
http://localhost:5678
http://localhost:50080
http://localhost:8188
./start.sh
./start.sh --stop
./start.sh --status
./start.sh --logs
./start.sh --cpu
Solution:
# Add yourself to docker group
sudo usermod -aG docker $USER
# Log out and log back in, or run:
newgrp docker
# Try again
./start.sh
Solution:
# Start Docker service
sudo systemctl start docker
# Enable Docker to start on boot
sudo systemctl enable docker
# Check status
sudo systemctl status docker
Solution:
# Find what's using the port
sudo lsof -i :5678
sudo lsof -i :8188
sudo lsof -i :50080
# Kill the process (replace PID with actual number)
sudo kill -9 PID
# Or just restart
sudo reboot
Solution:
# Check disk space
df -h
# Clean up Docker
docker system prune -a
# Clean up apt cache
sudo apt clean
sudo apt autoremove
Solution:
# Install NVIDIA drivers
sudo ubuntu-drivers autoinstall
# Install NVIDIA Container Toolkit
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt update
sudo apt install -y nvidia-container-toolkit
# Restart Docker
sudo systemctl restart docker
# Test GPU
docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi
If you want to access from other computers on your network:
# Allow ports through firewall
sudo ufw allow 5678/tcp
sudo ufw allow 8188/tcp
sudo ufw allow 50080/tcp
# Enable firewall if not already enabled
sudo ufw enable
# Check status
sudo ufw status
sudo systemctl status docker
docker ps
docker compose logs -f
./start.sh --stop
docker system prune -f
./start.sh
./start.sh --stop
docker compose down -v
rm -rf data/ shared/
./start.sh
Create a file ~/Desktop/ai-stack.desktop:
cat > ~/Desktop/ai-stack.desktop << 'EOF'
[Desktop Entry]
Type=Application
Name=AI Stack
Comment=Start AI Automation Stack
Exec=gnome-terminal -- bash -c "cd ~/n8n-workflows/ai-stack && ./start.sh; exec bash"
Icon=applications-internet
Terminal=true
EOF
chmod +x ~/Desktop/ai-stack.desktop
# Create systemd service
sudo nano /etc/systemd/system/ai-stack.service
Paste this:
[Unit]
Description=AI Automation Stack
After=docker.service
Requires=docker.service
[Service]
Type=oneshot
RemainAfterExit=yes
WorkingDirectory=/home/YOUR_USERNAME/n8n-workflows/ai-stack
ExecStart=/home/YOUR_USERNAME/n8n-workflows/ai-stack/start.sh
ExecStop=/home/YOUR_USERNAME/n8n-workflows/ai-stack/start.sh --stop
User=YOUR_USERNAME
[Install]
WantedBy=multi-user.target
Replace YOUR_USERNAME with your actual username, then:
sudo systemctl enable ai-stack
sudo systemctl start ai-stack
# Install htop for better monitoring
sudo apt install -y htop
# Watch Docker stats
docker stats
# Watch GPU usage (if NVIDIA)
watch -n 1 nvidia-smi
Your AI Automation Stack is now running on Ubuntu!
workflows/comfyui-simple-test.jsonHappy automating! š