Skip to main content
Published on

How to Install OpenClaw (formerly ClawdBot/Moltbot) on Linux

Authors
  • avatar
    Name
    Stryxon
    Twitter

How to Install OpenClaw (formerly ClawdBot/Moltbot) on Linux

OpenClaw (formerly known as ClawdBot or Moltbot) is a powerful automation bot that helps streamline your workflow on Linux. This comprehensive guide covers installation on popular Linux distributions including Ubuntu, Debian, Fedora, and Arch Linux.

Don't want to mess with the terminal?

Hire us to set up a secure OpenClaw instance for you.

✓ No terminal required✓ Malware-free guarantee✓ Secure cloud hosting

Prerequisites

Before installing ClawdBot, ensure your system meets the following requirements:

  • Linux distribution (Ubuntu 20.04+, Debian 10+, Fedora 35+, or Arch Linux)
  • Python 3.8 or higher
  • Package manager (apt, dnf, or pacman)
  • At least 2GB of free disk space
  • Sudo/root access for system-wide installation

Step 1: Update Your System

First, update your package lists and upgrade existing packages.

Ubuntu/Debian:

Bash
sudo apt update && sudo apt upgrade -y

Fedora:

Bash
sudo dnf update -y

Arch Linux:

Bash
sudo pacman -Syu

Step 2: Install Python 3 and Dependencies

Most modern Linux distributions come with Python 3 pre-installed. Verify your Python version:

Bash
python3 --version

If Python 3.8+ is not installed, install it:

Ubuntu/Debian:

Bash
sudo apt install python3 python3-pip python3-venv git curl wget -y

Fedora:

Bash
sudo dnf install python3 python3-pip git curl wget -y

Arch Linux:

Bash
sudo pacman -S python python-pip git curl wget

Step 3: Install Build Dependencies

ClawdBot may require compilation tools for some Python packages:

Ubuntu/Debian:

Bash
sudo apt install build-essential libssl-dev libffi-dev python3-dev -y

Fedora:

Bash
sudo dnf groupinstall "Development Tools" -y sudo dnf install openssl-devel libffi-devel python3-devel -y

Arch Linux:

Bash
sudo pacman -S base-devel openssl libffi

Step 4: Clone the ClawdBot Repository

Navigate to your preferred installation directory and clone the repository:

Bash
cd ~/Documents git clone https://github.com/clawdbot/moltbot.git cd moltbot

Note: Replace the repository URL with the actual ClawdBot/Moltbot repository if different.

Cloning ClawdBot repository

Step 5: Create a Virtual Environment

It's best practice to use a virtual environment for Python projects:

Bash
python3 -m venv venv source venv/bin/activate

Your terminal prompt should now show (venv) indicating the virtual environment is active.

Step 6: Install ClawdBot

With the virtual environment activated, install ClawdBot and its dependencies:

Bash
pip install --upgrade pip pip install -r requirements.txt

If ClawdBot is available on PyPI, you can alternatively install it directly:

Bash
pip install clawdbot

Step 7: Configure ClawdBot

Create a configuration directory and copy the example configuration:

Bash
mkdir -p ~/.config/clawdbot cp config.example.yml ~/.config/clawdbot/config.yml

Edit the configuration file with your preferred text editor:

Bash
nano ~/.config/clawdbot/config.yml # or use vim, emacs, or any editor you prefer

Update the following settings:

  • API keys (if required)
  • Bot preferences
  • Automation triggers
  • Notification settings
  • Log file locations

Step 8: Verify Installation

Test that ClawdBot is properly installed:

Bash
clawdbot --version

Run a test command to ensure everything works:

Bash
clawdbot test

Step 9: Set Up Systemd Service (Optional)

To have ClawdBot start automatically on boot and run as a system service, create a systemd service file:

Bash
sudo nano /etc/systemd/system/clawdbot.service

Add the following content (adjust paths as needed):

INI
[Unit] Description=ClawdBot Automation Service After=network.target [Service] Type=simple User=YOUR_USERNAME WorkingDirectory=/home/YOUR_USERNAME/Documents/moltbot ExecStart=/home/YOUR_USERNAME/Documents/moltbot/venv/bin/python -m clawdbot start Restart=always RestartSec=10 [Install] WantedBy=multi-user.target

Enable and start the service:

Bash
sudo systemctl daemon-reload sudo systemctl enable clawdbot sudo systemctl start clawdbot

Check the service status:

Bash
sudo systemctl status clawdbot

Step 10: Configure Firewall (If Needed)

If ClawdBot requires network access, configure your firewall:

UFW (Ubuntu/Debian):

Bash
sudo ufw allow 8080/tcp sudo ufw reload

Firewalld (Fedora):

Bash
sudo firewall-cmd --permanent --add-port=8080/tcp sudo firewall-cmd --reload

Troubleshooting

Issue: Permission Denied Errors

If you encounter permission errors:

Bash
sudo chown -R $USER:$USER ~/Documents/moltbot chmod -R 755 ~/Documents/moltbot

Issue: Python Module Not Found

If you see "ModuleNotFoundError", ensure your virtual environment is activated:

Bash
source ~/Documents/moltbot/venv/bin/activate pip install -r requirements.txt

Issue: SSL Certificate Errors

If you encounter SSL errors, update your certificates:

Bash
pip install --upgrade certifi

For Ubuntu/Debian:

Bash
sudo apt install ca-certificates sudo update-ca-certificates

Issue: Port Already in Use

If the default port is in use, modify the configuration:

Bash
nano ~/.config/clawdbot/config.yml # Change port: 8080 to another port like 8081

Issue: Systemd Service Fails

Check the service logs:

Bash
sudo journalctl -u clawdbot -f

Ensure the paths in the service file are correct and the user has permissions.

Issue: Dependencies Conflict

If you have dependency conflicts, create a fresh virtual environment:

Bash
deactivate rm -rf venv python3 -m venv venv source venv/bin/activate pip install -r requirements.txt

Updating ClawdBot

To update ClawdBot to the latest version:

Bash
cd ~/Documents/moltbot source venv/bin/activate git pull origin main pip install --upgrade -r requirements.txt

If using systemd, restart the service:

Bash
sudo systemctl restart clawdbot

Uninstalling ClawdBot

If you need to uninstall ClawdBot:

  1. Stop and disable the systemd service (if configured):
Bash
sudo systemctl stop clawdbot sudo systemctl disable clawdbot sudo rm /etc/systemd/system/clawdbot.service sudo systemctl daemon-reload
  1. Deactivate and remove the virtual environment:
Bash
deactivate rm -rf ~/Documents/moltbot
  1. Remove configuration files:
Bash
rm -rf ~/.config/clawdbot
  1. (Optional) Remove Python and dependencies if not needed:
Bash
# Ubuntu/Debian sudo apt remove python3-venv python3-pip # Fedora sudo dnf remove python3-pip

Distribution-Specific Notes

Ubuntu/Debian Specific

  • Use apt for package management
  • Configuration typically stored in ~/.config/
  • Logs usually in /var/log/ or ~/.local/share/

Fedora Specific

  • Use dnf for package management
  • SELinux may require additional configuration
  • Use sudo setsebool -P httpd_can_network_connect 1 if network issues occur

Arch Linux Specific

  • Use pacman for package management
  • AUR may have ClawdBot package: yay -S clawdbot
  • Keep system updated: sudo pacman -Syu regularly

Advanced Configuration

Running ClawdBot with Docker

If you prefer containerization:

Bash
docker pull clawdbot/moltbot:latest docker run -d --name clawdbot \ -v ~/.config/clawdbot:/config \ -p 8080:8080 \ clawdbot/moltbot:latest

Running Behind Nginx Reverse Proxy

Create an Nginx configuration:

Nginx
server { listen 80; server_name bot.yourdomain.com; location / { proxy_pass http://localhost:8080; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } }

Conclusion

You now have ClawdBot (Moltbot) successfully installed and configured on your Linux system. The bot is ready to automate your workflows and boost your productivity.

For advanced features, custom integrations, and troubleshooting, check out:

  • Official documentation at docs.clawdbot.io
  • Community forum for support
  • GitHub Issues for bug reports

Happy automating on Linux!