Troubleshooting
Common issues and quick fixes.
Installation Issues
Section titled “Installation Issues””403 Forbidden” when running install script
Section titled “”403 Forbidden” when running install script”Problem: Running curl -fsSL https://devbox.ar0.eu/install.sh | bash returns 403 (often in managed shells like AWS CloudShell).
Explanation: Some environments block or challenge CDN traffic. Our mirror uses a CDN and may be affected. We’ve added a server-side fallback to redirect to GitHub Raw, but certain environments still enforce restrictions.
Solutions:
# Use the primary GitHub Raw URLcurl -fsSL https://raw.githubusercontent.com/itzcozi/devbox/main/install.sh | bash
# Or download and run locallycurl -fsSL -o install.sh https://raw.githubusercontent.com/itzcozi/devbox/main/install.shbash install.shAmazon Linux 2023
Section titled “Amazon Linux 2023”Problem: The install script reports an unsupported OS on Amazon Linux 2023.
Explanation: devbox officially supports Debian/Ubuntu. Amazon Linux 2023 (AL2023) is Fedora-like and uses dnf instead of apt.
Workaround (manual):
# Install deps (rough equivalent)sudo dnf install -y git make golang dockersudo systemctl enable --now dockersudo usermod -aG docker $USER
# Build and install devboxgit clone https://github.com/itzcozi/devbox.gitcd devboxmake buildsudo make installNote: We may add broader distro support in the future; contributions welcome.
”Command not found: devbox”
Section titled “”Command not found: devbox””Problem: After installation, devbox command is not recognized.
Solutions:
# Check if devbox is in PATHwhich devbox
# Add to PATH if neededexport PATH="/usr/local/bin:$PATH"
# Make permanent (add to ~/.bashrc or ~/.zshrc)echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.bashrcsource ~/.bashrc
# Verify installationdevbox --help“Docker is not installed or not running”
Section titled ““Docker is not installed or not running””Problem: Devbox can’t connect to Docker daemon.
Solutions:
# Check Docker statussudo systemctl status docker
# Start Docker if stoppedsudo systemctl start dockersudo systemctl enable docker
# Check if user is in docker groupgroups $USER
# Add user to docker groupsudo usermod -aG docker $USER# Note: You must log out and back in for this to take effect
# Test Docker accessdocker ps“Permission denied while trying to connect to Docker”
Section titled ““Permission denied while trying to connect to Docker””Problem: User doesn’t have permission to access Docker socket.
Solutions:
# Add user to docker groupsudo usermod -aG docker $USER
# Restart terminal session or logout/login
# Alternatively, run with sudo (not recommended)sudo devbox init myprojectBox Issues
Section titled “Box Issues””Box not found” or “No such box”
Section titled “”Box not found” or “No such box””Problem: Box was manually deleted or doesn’t exist.
Solutions:
# Check what boxes existdocker ps -a --filter "name=devbox_"
# List devbox projectsdevbox list
# Recreate missing boxdevbox destroy myproject # Clean up trackingdevbox init myproject # Recreate
# Or force recreatedevbox init myproject --force“Box won’t start”
Section titled ““Box won’t start””Problem: Box fails to start or immediately exits.
Diagnosis:
# Check box statusdocker ps -a --filter "name=devbox_myproject"
# Check box logsdocker logs devbox_myproject
# Inspect box configurationdocker inspect devbox_myprojectSolutions:
# Try restarting boxdocker start devbox_myproject
# If still fails, recreate boxdevbox destroy myprojectdevbox init myproject
# Check Docker daemonsudo systemctl restart docker“Box stops immediately after starting”
Section titled ““Box stops immediately after starting””Problem: Box keeps exiting instead of staying running.
Solutions:
# Check what command box is runningdocker inspect devbox_myproject | grep -A 5 '"Cmd"'
# Box should run 'sleep infinity'# If not, recreate:devbox destroy myprojectdevbox init myproject
# Check for resource constraintsdocker stats --no-streamFile Access Issues
Section titled “File Access Issues””Files not showing up in box”
Section titled “”Files not showing up in box””Problem: Files created on host don’t appear in /workspace/ inside box.
Diagnosis:
# Check mount pointdocker inspect devbox_myproject | grep -A 10 '"Mounts"'
# Should show: ~/devbox/myproject -> /workspaceSolutions:
# Verify workspace directory existsls -la ~/devbox/myproject/
# Create file on host and check in boxecho "test" > ~/devbox/myproject/test.txtdevbox run myproject cat /workspace/test.txt
# If mount is wrong, recreate boxdevbox destroy myprojectdevbox init myproject“Permission denied accessing files”
Section titled ““Permission denied accessing files””Problem: Can’t read/write files in box workspace.
Solutions:
# Check file permissionsls -la ~/devbox/myproject/
# Fix ownership if neededsudo chown -R $USER:$USER ~/devbox/myproject/
# Check box userdevbox run myproject whoamidevbox run myproject id
# If running as different user, use sudo inside boxdevbox run myproject "sudo chown -R root:root /workspace/"Network and Port Issues
Section titled “Network and Port Issues””Port already in use”
Section titled “”Port already in use””Problem: Can’t bind to port specified in configuration.
Solutions:
# Check what's using the portsudo netstat -tlnp | grep :5000# orsudo ss -tlnp | grep :5000
# Kill process using portsudo kill -9 <PID>
# Or use different port in devbox.json# Change "5000:5000" to "5001:5000"
# Recreate box with new configdevbox destroy myprojectdevbox init myproject“Can’t access web application from host”
Section titled ““Can’t access web application from host””Problem: Web app running in box but not accessible from host.
Solutions:
# Ensure app binds to 0.0.0.0, not localhost# In your app: app.run(host='0.0.0.0', port=5000)
# Check port mapping in boxdocker port devbox_myproject
# Verify ports in devbox.jsoncat ~/devbox/myproject/devbox.json
# Test from inside boxdevbox run myproject "curl http://localhost:5000"
# Test from hostcurl http://localhost:5000Configuration Issues
Section titled “Configuration Issues””Invalid JSON in devbox.json”
Section titled “”Invalid JSON in devbox.json””Problem: Configuration file has syntax errors.
Solutions:
# Validate JSON syntaxcat ~/devbox/myproject/devbox.json | python3 -m json.tool
# Or use devbox validationdevbox config validate myproject
# Fix common JSON errors:# - Missing commas between elements# - Trailing commas# - Unquoted strings# - Mismatched brackets/braces“Setup commands fail during initialization”
Section titled ““Setup commands fail during initialization””Problem: Commands in setup_commands array fail.
Diagnosis:
# Check box logs during initdocker logs devbox_myproject
# Test commands manuallydevbox shell myproject# Run each setup command individuallySolutions:
# Common fixes:# 1. Add 'apt update' before package installs (though devbox does this automatically)# 2. Use full package names# 3. Add '-y' flag to apt commands# 4. Check command syntax
# Example working setup_commands:{ "setup_commands": [ "apt install -y python3-pip nodejs npm", "pip3 install flask requests", "npm install -g typescript" ]}
# Test commands step by stepdevbox shell myprojectapt install -y python3-pip # Should workpip3 install flask # Should workPerformance Issues
Section titled “Performance Issues””Box startup is slow”
Section titled “”Box startup is slow””Problem: Takes a long time to start boxes or run commands.
Solutions:
# Check Docker performancedocker system dfdocker system prune # Clean up unused resources
# Monitor during startuptime devbox shell myproject
# Check system resourcesdocker stats --no-streamtop“High disk usage”
Section titled ““High disk usage””Problem: Docker/devbox using too much disk space.
Solutions:
# Check disk usagedevbox cleanup --dry-run --alldocker system df -v
# Clean up unused resourcesdevbox cleanup --alldocker system prune -a
# Check individual boxesdocker exec devbox_myproject du -sh /var/cache/aptdevbox run myproject "apt autoclean"Recovery Procedures
Section titled “Recovery Procedures””Complete reset of devbox”
Section titled “”Complete reset of devbox””If everything is broken, start fresh:
# Stop all devbox boxesdocker stop $(docker ps -q --filter "name=devbox_")
# Remove all devbox boxesdocker rm $(docker ps -aq --filter "name=devbox_")
# Clean up Docker resourcesdocker system prune -a
# Remove devbox configurationrm -rf ~/.devbox/
# Keep or remove project files (your choice)# rm -rf ~/devbox/ # This deletes your code!
# Reinstall devbox if neededcurl -fsSL https://raw.githubusercontent.com/itzcozi/devbox/main/install.sh | bash“Recover project after box deletion”
Section titled ““Recover project after box deletion””If box was deleted but files remain:
# Check if files existls ~/devbox/myproject/
# Recreate boxdevbox init myproject
# If you had custom configuration# Edit ~/devbox/myproject/devbox.json# Then recreate:devbox destroy myprojectdevbox init myproject“Fix corrupted configuration”
Section titled ““Fix corrupted configuration””If global configuration is corrupted:
# Backup existing configcp ~/.devbox/config.json ~/.devbox/config.json.backup
# Reset configurationrm ~/.devbox/config.json
# Recreate projectsdevbox init project1devbox init project2# etc.Getting Help
Section titled “Getting Help”Debug Information
Section titled “Debug Information”When reporting issues, include:
# System informationuname -acat /etc/os-release
# Docker informationdocker --versiondocker info
# Devbox informationdevbox --versiondevbox list --verbose
# Box information (if applicable)docker logs devbox_myprojectdocker inspect devbox_myproject
# Configurationcat ~/.devbox/config.jsoncat ~/devbox/myproject/devbox.jsonLog Files
Section titled “Log Files”Useful log locations:
- Docker daemon:
journalctl -u docker.service - Box logs:
docker logs devbox_<project> - System messages:
/var/log/syslog
Common Commands for Diagnosis
Section titled “Common Commands for Diagnosis”# Check Docker daemonsudo systemctl status docker
# List all boxesdocker ps -a
# Check Docker disk usagedocker system df
# Test Docker functionalitydocker run hello-world
# Check devbox projectsdevbox listdevbox maintenance --health-check
# Check system resourcesdf -hfree -h