| English | 简体中文 |
Comprehensive cross-platform interactive server setup scripts for Ubuntu, CentOS, Debian, macOS, and Windows, installing essential modern development tools with a single command.
This project provides installation scripts for the following platforms:
| Platform | Script File | Package Manager | Description |
|---|---|---|---|
| Ubuntu | oh-my-opencode-agents.sh |
apt | Original script, supports Ubuntu 20.04/22.04/24.04 |
| CentOS/RHEL | install-centos.sh |
dnf/yum | Supports CentOS 7/8, RHEL, Rocky Linux, AlmaLinux |
| OpenCloud/Alibaba | install-centos.sh |
dnf | Alibaba Cloud, Tencent Cloud and other domestic cloud servers |
| Debian | install-debian.sh |
apt | Supports Debian 10/11/12 |
| macOS (Intel) | install-macos-x86.sh |
Homebrew | For Intel-based Macs |
| macOS (Apple Silicon) | install-macos-arm.sh |
Homebrew | For M1/M2/M3 chip Macs |
| Windows | install-windows.ps1 |
winget | PowerShell script, supports Windows 10/11 |
-y flag for fully automated installation-y flag for fully automated installationDue to network restrictions, users in China should use the GitHub proxy for faster downloads:
# Ubuntu (国内用户)
curl -fsSL https://gh-proxy.com/https://raw.githubusercontent.com/choovin/oh-my-opencode-agents/main/oh-my-opencode-agents.sh -o install-ubuntu.sh && chmod +x install-ubuntu.sh && ./install-ubuntu.sh
# macOS Apple Silicon (国内用户)
curl -fsSL https://gh-proxy.com/https://raw.githubusercontent.com/choovin/oh-my-opencode-agents/main/install-macos-arm.sh -o install-macos-arm.sh && chmod +x install-macos-arm.sh && ./install-macos-arm.sh
# CentOS / Debian (国内用户)
curl -fsSL https://gh-proxy.com/https://raw.githubusercontent.com/choovin/oh-my-opencode-agents/main/install-centos.sh -o install-centos.sh && chmod +x install-centos.sh && ./install-centos.sh
The script will automatically detect your network region and configure domestic mirrors (TUNA, Aliyun, npmmirror) for faster package downloads.
# Interactive mode
curl -fsSL https://raw.githubusercontent.com/choovin/oh-my-opencode-agents/main/oh-my-opencode-agents.sh -o install-ubuntu.sh && chmod +x install-ubuntu.sh && ./install-ubuntu.sh
# Auto mode
curl -fsSL https://raw.githubusercontent.com/choovin/oh-my-opencode-agents/main/oh-my-opencode-agents.sh -o install-ubuntu.sh && chmod +x install-ubuntu.sh && ./install-ubuntu.sh -y
# Interactive mode
curl -fsSL https://raw.githubusercontent.com/choovin/oh-my-opencode-agents/main/install-centos.sh -o install-centos.sh && chmod +x install-centos.sh && ./install-centos.sh
# Auto mode
curl -fsSL https://raw.githubusercontent.com/choovin/oh-my-opencode-agents/main/install-centos.sh -o install-centos.sh && chmod +x install-centos.sh && ./install-centos.sh -y
# Interactive mode
curl -fsSL https://raw.githubusercontent.com/choovin/oh-my-opencode-agents/main/install-debian.sh -o install-debian.sh && chmod +x install-debian.sh && ./install-debian.sh
# Auto mode
curl -fsSL https://raw.githubusercontent.com/choovin/oh-my-opencode-agents/main/install-debian.sh -o install-debian.sh && chmod +x install-debian.sh && ./install-debian.sh -y
# Interactive mode
curl -fsSL https://raw.githubusercontent.com/choovin/oh-my-opencode-agents/main/install-macos-x86.sh -o install-macos-x86.sh && chmod +x install-macos-x86.sh && ./install-macos-x86.sh
# Interactive mode
curl -fsSL https://raw.githubusercontent.com/choovin/oh-my-opencode-agents/main/install-macos-arm.sh -o install-macos-arm.sh && chmod +x install-macos-arm.sh && ./install-macos-arm.sh
# Run as Administrator
# Interactive mode
irm https://raw.githubusercontent.com/choovin/oh-my-opencode-agents/main/install-windows.ps1 | iex
# Or save and run the script
irm https://raw.githubusercontent.com/choovin/oh-my-opencode-agents/main/install-windows.ps1 -OutFile install-windows.ps1
.\install-windows.ps1
# Clone the repository
git clone https://github.com/choovin/oh-my-opencode-agents.git
cd oh-my-opencode-agents
# Make scripts executable
chmod +x install-*.sh
# Run the script for your platform
./install-ubuntu.sh # Ubuntu
./install-centos.sh # CentOS/RHEL/Alibaba
./install-debian.sh # Debian
./install-macos-x86.sh # macOS Intel
./install-macos-arm.sh # macOS Apple Silicon
| Tool | Version | Purpose |
|---|---|---|
| Git | Latest | Version control system |
| Zsh + Oh-My-Zsh | Latest | Enhanced shell with framework |
| Zoxide | Latest | Smart cd command (remembers directories) |
| Lazygit | Latest | Terminal UI for git |
| Lazydocker | Latest | Terminal UI for Docker |
| Docker CE | Latest | Containerization platform |
| Neovim | v0.10+ | Modern text editor |
| LuaRocks | Latest | Lua package manager |
| Node.js LTS | v20.x+ | JavaScript runtime (npm, yarn, pnpm) |
| UV | Latest | Fast Python package manager |
| Poetry | Latest | Python dependency management & packaging |
| GCC & Build Tools | Latest | Compiler and development essentials |
| Tool | Version | Purpose |
|---|---|---|
| OpenCode Manager | Latest | Self-hosted development environment manager |
| Baota Panel | Latest | Web-based server management panel |
| Nginx (via Baota) | 1.24.0+ | High-performance reverse proxy with WebSocket support |
| Tool | Purpose |
|---|---|
| btop | Modern system resource monitor |
| tmux | Terminal multiplexer |
| fzf | Fuzzy finder for files and history |
| ripgrep (rg) | Fast grep alternative |
| fd | Fast find alternative |
./oh-my-opencode-agents.sh
The script will:
./oh-my-opencode-agents.sh -y
# or
./oh-my-opencode-agents.sh --yes
Perfect for:
./oh-my-opencode-agents.sh --help
# Download, make executable, and run interactively
curl -fsSL https://raw.githubusercontent.com/choovin/oh-my-opencode-agents/main/oh-my-opencode-agents.sh -o oh-my-opencode-agents.sh && chmod +x oh-my-opencode-agents.sh && ./oh-my-opencode-agents.sh
# Download and auto-install everything
curl -fsSL https://raw.githubusercontent.com/choovin/oh-my-opencode-agents/main/oh-my-opencode-agents.sh -o oh-my-opencode-agents.sh && chmod +x oh-my-opencode-agents.sh && ./oh-my-opencode-agents.sh -y
# 1. Download script
curl -O https://raw.githubusercontent.com/choovin/oh-my-opencode-agents/main/oh-my-opencode-agents.sh
# 2. Make executable
chmod +x oh-my-opencode-agents.sh
# 3. Run (interactive mode)
./oh-my-opencode-agents.sh
# 4. Check logs
cat ~/ubuntu-setup-*.log
# Full automatic installation
./oh-my-opencode-agents.sh -y
# Run as root (not recommended)
sudo bash oh-my-opencode-agents.sh -y
========================================
Pre-Installation Status Check
========================================
[INFO] Checking what is currently installed...
✓ git: git version 2.43.0
✗ zsh: not installed
✗ lazygit: not installed
✓ docker: Docker version 24.0.7
...
Continue with installation? [Y/n]: y
========================================
Git Installation
========================================
[WARN] Git is already installed (git version 2.43.0)
Reinstall/upgrade git? [y/N]: n
...
========================================
Installation Summary
========================================
Newly Installed:
✓ zsh: zsh 5.9
✓ lazygit: version=0.40.2
✓ neovim: NVIM v0.9.5
Upgraded:
↑ docker: Docker version 24.0.7 → Docker version 25.0.0
Already Installed (unchanged):
• git: git version 2.43.0
• tmux: tmux 3.3a
Actions performed during this run:
✓ System Updates
✓ Zsh + Oh-My-Zsh
✓ Lazygit
✓ Docker CE
✓ Neovim
✓ Zsh Config
./oh-my-opencode-agents.sh -y
# All prompts show [AUTO-YES]:
Continue with installation? [AUTO-YES]
Install/upgrade git? [AUTO-YES]
# ... everything installs automatically
# Or refresh Docker group immediately:
newgrp docker
docker --version
docker run hello-world
nvim --version
lazygit --version
lazydocker --version
echo $SHELL
# Should show: /usr/bin/zsh
The configured zsh includes:
do and press ↑ to see only commands starting with doz <partial-name> to jump to frequently used directoriesCtrl+R for fuzzy command history searchThe following aliases are configured in .zshrc:
vim='nvim' # Use Neovim instead of Vim
vi='nvim' # Use Neovim instead of Vi
lg='lazygit' # Quick access to lazygit
ld='lazydocker' # Quick access to lazydocker
Poetry is a modern Python dependency management and packaging tool that replaces requirements.txt and setup.py.
| Feature | Traditional (pip) | Poetry |
|---|---|---|
| Dependency Resolution | Manual, conflicts common | Automatic, resolves conflicts |
| Lock File | requirements.txt (loose) | poetry.lock (exact versions) |
| Virtual Environments | Manual (venv) | Automatic, in-project by default |
| Packaging | setup.py + MANIFEST.in | Single pyproject.toml |
| Publishing | twine + multiple commands | poetry publish |
# Create a new project
poetry new my-project
cd my-project
# Or initialize Poetry in existing project
poetry init
# Add dependencies
poetry add requests
poetry add pytest --group dev
# Add specific version
poetry add torch@2.1.0
# Install from lock file (production)
poetry install --no-dev
# Update dependencies
poetry update
# Run commands in virtual environment
poetry run python main.py
poetry run pytest
# Activate shell in venv
poetry shell
# Build and publish
poetry build
poetry publish
# Create AI project
poetry new ai-project
cd ai-project
# Add ML dependencies
poetry add torch transformers datasets
poetry add jupyter --group dev
# Install everything
poetry install
# Run Jupyter from within venv
poetry run jupyter lab
Poetry is configured to create virtual environments inside project directories:
# Check config
poetry config --list
# Virtual envs in project (already set by script)
poetry config virtualenvs.in-project true
# Default Python version
poetry env use python3.11
my-project/
├── pyproject.toml # Project config & dependencies
├── poetry.lock # Locked dependency versions
├── README.md
├── my_project/
│ └── __init__.py
├── tests/
└── .venv/ # Virtual environment (in-project)
# Get venv path for VS Code
poetry env info --path
# Set Python interpreter in VS Code to:
# <project-path>/.venv/bin/python
The script can automatically configure Nginx as a reverse proxy for OpenCode Manager:
http://www.sailfish.com.cnhttp://www.sailfish.com.cn → http://127.0.0.1:5003
/www/server/panel/vhost/nginx/www.sailfish.com.cn.conf
# Start/Stop/Reload Nginx
sudo /etc/init.d/nginx start
sudo /etc/init.d/nginx stop
sudo /etc/init.d/nginx reload
# Test configuration
/www/server/nginx/sbin/nginx -t
# View logs
tail -f /www/wwwlogs/www.sailfish.com.cn.log
tail -f /www/wwwlogs/www.sailfish.com.cn.error.log
| Type | Location |
|---|---|
| Log file | ~/ubuntu-setup-YYYYMMDD-HHMMSS.log |
| Backups | ~/.config-backups/YYYYMMDD-HHMMSS/ |
| Zsh config | ~/.zshrc |
| Neovim config | ~/.config/nvim/ |
The script clones your custom Neovim configuration from:
git@github.com:choovin/nvimconfig.git (SSH)https://github.com/choovin/nvimconfig.git (HTTPS)Note: SSH requires GitHub SSH key setup. If SSH fails, HTTPS is attempted automatically.
⚠️ Important: Members of the docker group have root-level privileges on the host system.
All existing configurations are backed up to ~/.config-backups/ before modification:
# View backups
ls -la ~/.config-backups/
# Restore a backup
cp -r ~/.config-backups/20250122-143022/nvim-143500 ~/.config/nvim
Issue: Script fails with “permission denied”
# Solution: Make script executable
chmod +x oh-my-opencode-agents.sh
Issue: Docker commands require sudo
# Solution: Log out and back in, or run:
newgrp docker
Issue: Neovim config clone fails
# Solution: Setup SSH key for GitHub
ssh-keygen -t ed25519 -C "your_email@example.com"
cat ~/.ssh/id_ed25519.pub
# Add the public key to GitHub: Settings → SSH keys
Issue: Zsh not activated
# Solution: Check default shell
echo $SHELL
# If not zsh, change manually:
chsh -s $(which zsh)
# Then log out and back in
Issue: History search not working with arrows
# Solution: Check plugin installation
ls ~/.oh-my-zsh/custom/plugins/zsh-history-substring-search
# If missing, clone manually:
git clone https://github.com/zsh-users/zsh-history-substring-search \
~/.oh-my-zsh/custom/plugins/zsh-history-substring-search
# View detailed log
cat ~/ubuntu-setup-*.log
# Check specific tool
which lazygit
lazygit --version
# Verify Docker group
groups
# Should include 'docker'
# Test Docker without sudo
docker ps
Edit the script to skip or add components:
# Comment out unwanted installations in main() function
# install_btop && installed_components+=("Btop") # Disabled
Edit ~/.zshrc:
# Change from robbyrussell to another theme
ZSH_THEME="agnoster" # or "powerlevel10k", "spaceship", etc.
Edit ~/.zshrc:
plugins=(
git
docker
zoxide
fzf
zsh-history-substring-search
# Add more plugins here
kubectl
terraform
aws
)
This script follows industry best practices:
✅ Strict error handling (set -euo pipefail)
✅ Color codes only for terminal output
✅ Comprehensive logging to file
✅ Backup before modification
✅ Official package sources (PPAs, repos)
✅ User permission validation
✅ Internet connectivity check
✅ Idempotent operations (safe to re-run)
This project is licensed under the MIT License.
Author: choovin Date: 2025-02-03 Version: 0.1.0-beta
# First time use
chmod +x oh-my-opencode-agents.sh && ./oh-my-opencode-agents.sh
# Full automatic
./oh-my-opencode-agents.sh -y
# View logs
cat ~/ubuntu-setup-*.log
# Refresh Docker permissions
newgrp docker
# Test all tools
docker run hello-world && lazygit --version && nvim --version
# Poetry usage
poetry new my-project # Create new project
poetry add <package> # Add dependency
poetry install # Install from poetry.lock
poetry run <command> # Run command in virtualenv
poetry shell # Activate virtualenv
poetry config virtualenvs.in-project true # Store venvs in project dirs
Happy Coding! 🚀