An automated, developer-focused bootstrap script to configure a fresh Ubuntu workstation into a high-productivity development environment in minutes.
Whether you are setting up a local machine, a fresh VM, or a remote server, ubuntu-dev-setup installs core utilities, configures containerization, sets up optimized system limits, configures rapid Python package tooling, registers helpful aliases, and sets up Git/SSH credentials securely.
- π¦ Core Utilities & Toolchains: Installs essential development packages (
git,gh,curl,jq,htop,vim,lsof,build-essential,openssh). - π³ Docker Ecosystem: Installs Docker Engine & Docker Compose (v2) from official Docker repositories, configures non-root access, and configures Docker CLI shell auto-completions.
- β‘ Lightning Fast Python: Installs Astral's
uv(fast Python toolchain manager) and automatically configures shell autocompletions for Bash and Zsh. - π¨ Interactive Node.js Setup (Optional): Prompts to install Fast Node Manager (
fnm) and Node.js LTS, keeping your JavaScript setup modern and switchable. - π¦ Rust Toolchain (Optional): Installs
rustupwith the stable toolchain and automatically configures~/.cargo/envin all shell profiles. - πΉ Go Toolchain (Optional): Downloads and installs the latest official Go release from
go.devinto/usr/local/goand injects$GOPATH/bininto your shell PATH. - π Starship Prompt (Optional): Installs Starship β a blazing-fast, infinitely customizable cross-shell prompt β and registers its init hook for Bash and Zsh.
- π οΈ Modern CLI Power-ups (Optional): Prompts to install high-productivity command line utilities:
fzf(fuzzy finder),ripgrep(search), andbat(enhanced cat with syntax highlighting). - π₯οΈ Desktop IDEs (Optional / GUI-only): Safely detects a graphical desktop environment and offers to install VS Code (native Microsoft APT package) and PyCharm Community (classic Snap package).
- βοΈ Performance Tweaks: Optimizes Linux file-watcher limits (
fs.inotify.max_user_watches) to ensure smooth performance in heavy IDEs (like VS Code, IntelliJ, etc.). - π¨ Colorized Output: Every stage uses ANSI color-coded log helpers (
log_step,log_success,log_warning,log_error) so you can follow progress at a glance. - π» Productive Environment: Registers pre-configured, helpful shell aliases (e.g.,
gs,dco,dps) and PATH settings to both Bash and Zsh (via~/.bashrcand~/.zshrc). - π Interactive Identity Setup: Guides you through configuring Git global settings and generates modern
Ed25519SSH keys for GitHub/GitLab without overwriting existing keys. - π³ Container & Host Aware: Automatically detects if it is running inside a Docker container (where root is the default) or on a host machine, adapting permissions and execution styles accordingly.
- π Pre-flight Idempotency Check: Scans and displays current versions of all known tools before doing anything, so you know exactly what will change.
- π Post-install Summary Report: Prints a clean formatted table at the end showing every tool's status (newly installed with version, already installed, or skipped).
- π§ͺ
--dry-runMode: Preview every action the script would take without touching your system β perfect for auditing on shared or company machines. - π
--minimalMode: Non-interactive core-only install (apt packages, Docker,uv). Great for fast CI server bootstraps. - π€
--fullMode: Fully automated unattended install of everything. Perfect for CI/CD pipelines, provisioning scripts, and Dockerfiles.
Run using process substitution so interactive prompts work correctly:
bash <(wget -qO- https://raw.githubusercontent.com/Harshidpatel12/ubuntu-dev-setup/main/setup.sh)On a minimal image without wget:
sudo apt-get update && sudo apt-get install -y wget && bash <(wget -qO- https://raw.githubusercontent.com/Harshidpatel12/ubuntu-dev-setup/main/setup.sh)git clone https://github.com/Harshidpatel12/ubuntu-dev-setup.git
cd ubuntu-dev-setup
chmod +x setup.sh
./setup.shThe script supports several flags for different use cases:
| Flag | Description |
|---|---|
| (none) | Default interactive mode β prompts for each optional tool |
--dry-run |
Preview all actions without modifying the system |
--minimal |
Non-interactive: install core tools only (apt, Docker, uv) |
--full |
Non-interactive: install everything automatically |
--help |
Show usage information and exit |
Flags can be combined. For example:
# Preview a full install without touching anything (great for auditing)
./setup.sh --dry-run --full
# Fast CI server bootstrap β core tools only, no questions
./setup.sh --minimal
# Fully automated workstation setup β no prompts at all
./setup.sh --full
# Non-interactive setup via curl in CI/CD pipelines
bash <(wget -qO- https://raw.githubusercontent.com/Harshidpatel12/ubuntu-dev-setup/main/setup.sh) --full# Example Dockerfile snippet
RUN apt-get update && apt-get install -y curl wget sudo && \
wget -qO setup.sh https://raw.githubusercontent.com/Harshidpatel12/ubuntu-dev-setup/main/setup.sh && \
chmod +x setup.sh && ./setup.sh --fullHere is exactly what gets installed and configured:
The script updates your local package lists and installs the following:
- Version Control:
git,gh(official GitHub CLI) - Network & Fetching:
curl,openssh-server,openssh-client - Diagnostics & Monitoring:
htop,lsof,jq - Compilers & Build Tools:
build-essential(gcc, g++, make) - Text Editors:
vim - Utilities:
tldr(simplified man pages),bash-completion,unzip
- Installs official Docker engine using Docker's secure bootstrap script.
- Adds your current user to the
dockergroup so you don't have to typesudofor every command. - Sets up Docker CLI shell completion rules under
/etc/bash_completion.d/.
- Installs
uv, a drop-in replacement forpip,pip-tools, andvirtualenvwritten in Rust. - Speeds up Python package installations by 10-100x.
- Registers
uvshell autocompletion in your~/.bashrc.
Appends a dedicated block of developer aliases to your ~/.bashrc (safely and idempotently):
-
gs$\rightarrow$ git status -
dco$\rightarrow$ docker compose -
dps$\rightarrow$ docker ps --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}'
For large codebases, IDEs can quickly hit the default Linux file-watcher limit. The script increases fs.inotify.max_user_watches to 524288 inside /etc/sysctl.d/99-dev-tweaks.conf.
- Installs Fast Node Manager (
fnm), an ultra-fast Node.js version manager written in Rust. - Automatically downloads and configures the latest Node.js LTS version.
- Installs
rustupβ the official Rust toolchain installer β in non-interactive mode. - Appends
source ~/.cargo/envto all detected shell profiles socargo,rustc, andrustupare available immediately after a terminal restart. - Skips installation if
rustcis already on$PATH.
- Fetches the latest stable Go release version directly from
go.dev/VERSIONand downloads the official Linux tarball. - Installs Go into
/usr/local/goand cleans up the temporary archive. - Injects both
/usr/local/go/binand~/go/bin($GOPATH/bin) into all shell profiles idempotently.
- Installs Starship using the official one-line install script in
--yes(non-interactive) mode. - Appends the correct
eval "$(starship init bash|zsh)"hook to each detected shell profile. - Safe to re-run β a guard marker prevents duplicate hook entries.
- Installs
fzf(fuzzy finder) for interactive command-line searches. - Installs
ripgrep(rg) for rapid recursive file searching. - Installs
bat(acatclone with syntax highlighting) and configures abatcommand redirect so it launches natively on Ubuntu.
- Automatically checks if a display server is running (
$DISPLAYor$WAYLAND_DISPLAY) to avoid installing graphical programs on remote headless servers or minimal CLI containers. - Installs VS Code via Microsoft's official GPG-signed APT repository (recommended over snap for system terminal shell integration).
- Installs PyCharm Community Edition via canonical classic snap packages.
- Idempotent Execution: You can safely run this script multiple times. If Docker,
uv, or specific aliases are already installed/present, the script will skip them. - No Destructive Overwrites: The SSH key generator checks for the existence of
~/.ssh/id_ed25519and will never overwrite your existing SSH keys. - Non-Root Safety: Docker group permission changes are only applied to the actual user running the script, ensuring your root space stays clean.
Below is a reference list of the tools managed by this script, complete with their official documentation links:
| Tool | Category | Purpose | Documentation |
|---|---|---|---|
| Git | Core (Default) | Distributed version control system | git-scm.com |
| gh (GitHub CLI) | Core (Default) | Official command-line client for GitHub | cli.github.com |
| Docker / Compose | Core (Default) | Containerization engine & multi-container manager | docs.docker.com |
Astral uv |
Core (Default) | Blazing fast Python package installer and resolver | docs.astral.sh/uv |
| curl | Core (Default) | Command-line tool for transferring data with URLs | curl.se |
| jq | Core (Default) | Command-line JSON parser and processor | jqlang.github.io/jq |
| htop | Core (Default) | Interactive process viewer and system monitor | htop.dev |
| vim | Core (Default) | Terminal-based text editor | vim.org |
| lsof | Core (Default) | Utility to list open files and network ports | man7.org/lsof |
| build-essential | Core (Default) | Compiler toolchains (gcc, g++, make, etc.) | gcc.gnu.org |
| OpenSSH | Core (Default) | Secure remote login protocol and agents | openssh.com |
| tldr | Core (Default) | Simplified, community-driven terminal man pages | tldr.sh |
| bash-completion | Core (Default) | Tab-completion rules for command-line tools | github.com/scop |
| unzip | Core (Default) | Archive extraction; required by fnm and other tools | Ubuntu APT |
| FNM (Node Manager) | Optional (Prompt) | Blazing-fast Node.js version manager in Rust | fnm.vercel.app |
| Node.js (LTS) | Optional (Prompt) | JavaScript runtime environment | nodejs.org |
| fzf | Optional (Prompt) | Command-line fuzzy finder for files and history | github.com/fzf |
ripgrep (rg) |
Optional (Prompt) | Line-oriented search tool (modern grep replacement) | github.com/ripgrep |
| bat | Optional (Prompt) | Cat clone with syntax highlighting & Git diffs | github.com/bat |
| Rust (rustup) | Optional (Prompt) | Systems programming language and toolchain manager | rustup.rs |
| Go (Golang) | Optional (Prompt) | Statically typed compiled programming language | go.dev |
| Starship | Optional (Prompt) | Cross-shell fast & customizable prompt | starship.rs |
| VS Code | Optional (GUI Only) | Standard graphical code editor | code.visualstudio.com |
| PyCharm Community | Optional (GUI Only) | Python integrated development environment | jetbrains.com/pycharm |
To maintain consistent style rules and code quality, this project uses pre-commit git hook checks.
To set up the pre-commit hooks locally:
-
Install
pre-commit(usinguvorpip):uv tool install pre-commit # Or using pip: pip install pre-commit -
Register the Git hooks:
pre-commit install
Now, every time you run git commit, your files will automatically be formatted using shfmt and prettier, and validated using shellcheck.
To run the checks manually on all files:
pre-commit run --all-filesContributions are welcome! If you want to add support for more tools, shells (like Zsh/Oh My Zsh), or configurations:
- Fork the Project.
- Create your Feature Branch (
git checkout -b feature/AmazingFeature). - Commit your Changes (
git commit -m 'Add some AmazingFeature'). - Push to the Branch (
git push origin feature/AmazingFeature). - Open a Pull Request.
Distributed under the MIT License. See LICENSE for more information.