This repository contains an Ansible playbook (dev-setup.yml) designed to automate the setup of a powerful developer workstation based on Ubuntu Desktop. It aims to install and configure a range of essential development tools and services.
The dev-setup.yml playbook automates the installation and configuration of various software components required for a modern development workflow. By running this playbook, you can quickly set up a consistent environment including language version managers, containerization tools, databases, and IDEs.
- A machine running Ubuntu Desktop (or a compatible Debian-based distribution).
gitinstalled on the target machine to clone this repository.ansibleinstalled on the target machine. You can typically install it usingsudo apt update && sudo apt install ansible.- Sudo privileges for the user running the playbook, as some tasks require root access (handled by
become: yesin the playbook). - An active internet connection to download packages, tools, and container images.
This repository includes a simple bash script, install-dev.sh, to facilitate running the Ansible playbook with the necessary options.
-
Clone the repository:
git clone https://github.com/jsbhullar/dev-setup.git cd dev-setup -
Make the script executable:
chmod +x install-dev.sh
-
Run the installation script:
./install-dev.sh
The script will:
- Print introductory messages.
- Prompt you if you want to enable verbose output for the Ansible run (you can enter
-v,-vv,-vvv, or just press Enter for no verbosity). - Execute the
ansible-playbook dev-setup.yml -K [verbosity]command. The-Kflag will prompt you for your user's password for sudo (privilege escalation) when the playbook requires it. - The Ansible playbook will then run, prompting you interactively for each optional component you wish to install (Go, Rust, Ollama, etc.). Respond with
yesorno.
The dev-setup.yml playbook performs the following actions:
-
Base System Setup:
- Updates the system's package list (
apt update). - Installs essential build tools and common packages (
build-essential,curl,git,unzip,zip,software-properties-common,apt-transport-https,ca-certificates,gnupg, and various development libraries likelibssl-dev,zlib1g-dev,libreadline-dev,libffi-dev, etc., along withpython3-pip).
- Updates the system's package list (
-
Python Stack (via pyenv):
- Installs
pyenvby cloning its repository into~/.pyenv. - Adds
pyenvinitialization lines to the user's~/.bashrcfile to configure the shell environment. - Installs Python version
3.12.3usingpyenv. - Sets Python
3.12.3as the global default Python version for the user usingpyenv. - Installs
pipxusing the newly installed Python version. - Installs
uv(a fast Python package installer and resolver) usingpipx.
- Installs
-
Node.js (via nvm):
- Installs
nvm(Node Version Manager) using its official install script into~/.nvm. - Adds
nvminitialization lines to the user's~/.bashrcfile. - Installs the latest LTS (Long Term Support) version of Node.js using
nvm.
- Installs
-
Rust (Optional):
- If you choose to install Rust: Downloads and runs the
rustup.rsscript to install Rust and the Cargo package manager. - Adds Cargo's binary directory (
~/.cargo/bin) to the user'sPATHin~/.bashrc.
- If you choose to install Rust: Downloads and runs the
-
Go (Optional):
- If you choose to install Go: Downloads the Go
1.22.3binary release for Linux AMD64. - Extracts the Go archive to
/usr/local. - Adds the Go binary directory (
/usr/local/go/bin) to the user'sPATHin~/.bashrc.
- If you choose to install Go: Downloads the Go
-
Docker (Optional):
- If you choose to install Docker: Downloads and runs the official
get-docker.shconvenience script. - Adds the current user to the
dockergroup, allowing non-root execution of Docker commands (requires logging out and back in or restarting the system to take effect). - Ensures the Docker systemd service is enabled and started.
- If you choose to install Docker: Downloads and runs the official
-
Portainer (Optional, Docker GUI):
- If you choose to install Portainer and Docker: Creates a Docker volume named
portainer_data. - Runs the
portainer/portainer-ce:latestDocker container, configured to start automatically, expose ports8000(edge agent) and9443(web UI), and use theportainer_datavolume. Access the UI athttps://localhost:9443.
- If you choose to install Portainer and Docker: Creates a Docker volume named
-
Ollama (Optional, Local LLM Runner):
- If you choose to install Ollama: Downloads and runs the official
ollama.com/install.shscript to install Ollama, a tool for running large language models locally.
- If you choose to install Ollama: Downloads and runs the official
-
Open WebUI (Optional, Ollama Frontend):
- If you choose to install Open WebUI and Ollama: Creates a directory
~/.open-webuifor data persistence. - Runs the
ghcr.io/open-webui/open-webuiDocker container, configured to restart unless stopped, map host port3002to container port3000, mount the data directory, and set theOLLAMA_BASE_URLto connect to the locally installed Ollama instance. Access the UI athttp://localhost:3002.
- If you choose to install Open WebUI and Ollama: Creates a directory
-
PostgreSQL (in Docker):
- Runs a
postgres:16Docker container nameddev-postgres, configured to restart unless stopped. - Maps host port
5432to the container's port5432. - Sets environment variables for the default user (
devuser), password (devpass), and database (devdb). Connect to this instance atlocalhost:5432.
- Runs a
-
Visual Studio Code (Optional):
- If you choose to install VS Code: Downloads and installs the latest stable
code_*.debpackage from Microsoft. This typically also adds the VS Code repository for future updates viaapt. Launch usingcodein the terminal or via the application menu.
- If you choose to install VS Code: Downloads and installs the latest stable
-
pgAdmin 4 Desktop (Optional, PostgreSQL GUI):
- If you choose to install pgAdmin: Downloads the pgAdmin public key and adds it to the system's keyrings.
- Adds the official pgAdmin 4 APT repository to your system's software sources.
- Updates the APT cache and installs the
pgadmin4-desktoppackage. Launch via the application menu. Connect to thedev-postgrescontainer atlocalhost:5432using the defined credentials.
| Service | Access URL/Port | Notes |
|---|---|---|
| Portainer | https://localhost:9443 |
Docker GUI |
| Open WebUI | http://localhost:3002 |
Frontend for local Ollama instance |
| PostgreSQL | localhost:5432 |
Development database instance (devdb) |
Note: The Dokploy service mentioned in previous README versions is not included in the current dev-setup.yml playbook provided.
Feel free to fork this repository and modify the dev-setup.yml playbook to fit your specific development needs. If you identify improvements to the playbook structure or find issues, consider opening a pull request.
MIT License
Copyright (c) [2025] [Meharsoft Technologies Pvt.Ltd.]
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.