An automated, containerized local development environment powered by Ansible
Features β’ Quick Start β’ Documentation β’ Contributing
- Overview
- Features
- Available Applications
- Prerequisites
- Installation
- Configuration
- Deployment
- Uninstallation
- Application Access
- Project Structure
- Documentation
- GitHub Infrastructure as Code
- Development
- Troubleshooting
- Contributing
- Author
- License
Local Projects is a fully automated infrastructure-as-code solution for deploying a complete local development environment. Using Ansible playbooks and Docker containers, it allows you to quickly spin up essential development tools and services on any system.
Perfect for developers who want:
- π Reproducible development environments
- π³ Containerized applications for isolation
- π€ AI/LLM capabilities with Ollama and Open WebUI
- π Project management and collaboration tools
- π Secure configuration with Ansible Vault
- π― One-Command Deployment - Deploy all applications with a single Ansible playbook
- π§ Modular Architecture - Enable/disable applications individually via simple configuration
- π³ Docker-Based - All applications run in isolated containers
- π Secure by Default - Sensitive data encrypted with Ansible Vault
- π¨ Customizable - Easy configuration through YAML variables
- π Version Controlled - Infrastructure as Code approach
- π¦ Pre-configured - Ready-to-use setups with sensible defaults
- π GPU Support - NVIDIA GPU acceleration for Ollama (optional)
- β Quality Assured - Pre-commit hooks for code quality (Ansible Lint, YAML Lint, ShellCheck, Terraform validators)
The following applications can be deployed and managed through this project:
| Application | Description | Status | Port | Official Site |
|---|---|---|---|---|
| π Homer | Beautiful dashboard to organize all your web services | β Available | 8081 | homer |
| π¨Excalidraw | Virtual collaborative whiteboard for sketching diagrams | β Enabled by default | 8082 | excalidraw.com |
| ποΈPostgreSQL | Powerful open-source relational database | 5432 | postgresql.org | |
| πPlanka | Elegant open-source project management (Trello alternative) | 8083 | planka.app | |
| π€Ollama | Run large language models locally (Llama 3, Mistral, etc.) | β Enabled by default | 11434 | ollama.ai |
| πOpen WebUI | Feature-rich web interface for Ollama and OpenAI APIs | β Enabled by default | 8080 | openwebui.com |
By default, the following applications are enabled in group_vars/all/main.yml:
deploy_homer: true
deploy_excalidraw: true
deploy_open_webui: true
deploy_ollama: true
deploy_planka: false # Disabled by defaultNote: PostgreSQL is available as a role but currently commented out in the main playbook.
Get up and running in under 5 minutes:
# 1. Clone the repository
git clone https://github.com/xgueret/local-projects.git
cd local-projects
# 2. Install dependencies
pip install -r requirements.txt
ansible-galaxy collection install -r requirements.yml
# 3. Configure vault password
mkdir -p ~/Workspace/.vault
echo "your-vault-password" > ~/Workspace/.vault/.vault_password
# 4. Deploy!
ansible-playbook deploy.ymlAccess your applications:
- Open WebUI: http://localhost:8080
- Excalidraw: http://localhost:8082
For detailed setup instructions, see the Installation section below.
Ensure you have the following installed on your system:
| Requirement | Version | Purpose | Installation |
|---|---|---|---|
| Python | 3.x | Run Ansible | python.org |
| Ansible | 2.14+ | Automation engine | pip install ansible |
| Docker | Latest | Container runtime | docs.docker.com |
| Docker Compose | Latest | Multi-container orchestration | Included with Docker Desktop |
| Git | Latest | Version control | git-scm.com |
| NVIDIA Container Toolkit | Latest | GPU acceleration (optional) | NVIDIA Docs |
- OS: Linux, macOS, or Windows (WSL2)
- RAM: 4GB minimum (8GB+ recommended for Ollama)
- Disk: 20GB free space minimum
- GPU (optional): NVIDIA GPU with CUDA support for Ollama acceleration
- Clone the repository:
git clone https://github.com/xgueret/local-projects.git
cd local-projects- Install Python dependencies:
pip install -r requirements.txt- Install Ansible collections:
ansible-galaxy collection install -r requirements.yml- Configure pre-commit hooks:
pre-commit installThe project uses Ansible Vault to securely store sensitive information (passwords, API keys, etc.).
- Create a vault password file:
# Create directory if it doesn't exist
mkdir -p ~/Workspace/.vault
# Create password file (use a strong password!)
echo "your-secure-vault-password" > ~/Workspace/.vault/.vault_password
# Secure the password file
chmod 600 ~/Workspace/.vault/.vault_password- The vault configuration is set in
ansible.cfg:
vault_password_file = ~/Workspace/.vault/.vault_passwordYou can customize the deployment by modifying these configuration files:
| File | Purpose | Contains |
|---|---|---|
group_vars/all/main.yml |
Main configuration | App path, network settings, deployment flags |
group_vars/all/postgres.yml |
PostgreSQL settings | Database configuration |
group_vars/all/vault/ |
Sensitive data (encrypted) | Passwords, API keys, secrets |
roles/*/vars/main.yml |
App-specific settings | Ports, versions, container names |
ansible.cfg |
Ansible behavior | Inventory, vault, connection settings |
Edit group_vars/all/main.yml to control which applications are deployed:
# Example: Enable all applications
deploy_homer: true
deploy_excalidraw: true
deploy_open_webui: true
deploy_ollama: true
deploy_planka: true # Change to true to enableEach application has its own configuration in roles/<app_name>/vars/main.yml. For example:
Ollama (roles/ollama/vars/main.yml):
ollama_use_gpu: true # Enable/disable GPU acceleration
ollama_port: "11434" # Change port if neededOpen WebUI (roles/open_webui/vars/main.yml):
open_webui_version: "v0.6.34" # Specify version
open_webui_port: 8080 # Web interface port
open_webui_ollama_base_url: "http://127.0.0.1:11434" # Ollama connectionDeploy all enabled applications with a single command:
ansible-playbook deploy.ymlThis will:
- Create the application directory structure
- Set up a Docker network (
local_network) - Deploy all applications where
deploy_<app>: truein configuration - Start all containers
Use tags to deploy only specific applications:
# Deploy only Ollama and Open WebUI
ansible-playbook deploy.yml --tags "ollama,open_webui"
# Deploy only Excalidraw
ansible-playbook deploy.yml --tags "excalidraw"| Tag | Application | Status |
|---|---|---|
excalidraw |
Excalidraw whiteboard | β Active in playbook |
ollama |
Ollama LLM engine | β Active in playbook |
open_webui |
Open WebUI interface | β Active in playbook |
homer |
Homer dashboard | |
postgres |
PostgreSQL database | |
planka |
Planka project management |
After deployment, check that containers are running:
docker psYou should see containers named:
ollamaopen-webuiexcalidraw- (plus any other enabled applications)
Running uninstall.yml without tags will remove ALL applications! Always use tags unless you want to completely reset your environment.
# Uninstall a single application
ansible-playbook uninstall.yml --tags "ollama"
# Uninstall multiple applications
ansible-playbook uninstall.yml --tags "excalidraw,ollama,open_webui"# This will remove EVERYTHING!
ansible-playbook uninstall.ymlThe uninstall playbook performs the following actions:
- β Stops and removes Docker containers
- β Removes Ollama CLI tools (if uninstalling Ollama)
- β Preserves data volumes (must be manually removed if desired)
- β Preserves configuration files
All applications support uninstallation via tags:
| Tag | Application |
|---|---|
postgres |
PostgreSQL database |
homer |
Homer dashboard |
excalidraw |
Excalidraw whiteboard |
planka |
Planka project management |
ollama |
Ollama LLM engine |
open_webui |
Open WebUI interface |
To completely remove data and free up disk space:
# Remove application directory (β οΈ deletes all data!)
rm -rf ~/Workspace/07-local/app
# Remove Docker volumes
docker volume prune
# Remove Docker network
docker network rm local_networkOnce deployed, access your applications through these URLs:
| Application | URL | Description |
|---|---|---|
| πOpen WebUI | http://localhost:8080 | Web interface for Ollama models |
| π¨Excalidraw | http://localhost:8082 | Collaborative whiteboard |
| π Homer | http://localhost:8081 | Dashboard (if enabled) |
| πPlanka | http://localhost:8083 | Project management (if enabled) |
| π€Ollama API | http://localhost:11434 | Direct API access for Ollama |
| ποΈPostgreSQL | localhost:5432 | Database (internal only) |
For Open WebUI:
- Navigate to http://localhost:8080
- Create your admin account on first visit
- Download models from the Settings > Models section
- Start chatting!
For Ollama CLI:
# The Ollama CLI is automatically installed and available
ollama-local pull llama3 # Download a model
ollama-local run llama3 # Run the modellocal-projects/
β
βββ π Ansible Configuration
β βββ ansible.cfg # Ansible configuration
β βββ deploy.yml # Main deployment playbook
β βββ uninstall.yml # Application removal playbook
β βββ inventory.yml # Ansible inventory (localhost)
β
βββ βοΈ Configuration & Variables
β βββ group_vars/all/
β βββ main.yml # Main config (deployment flags, paths)
β βββ postgres.yml # PostgreSQL configuration
β βββ vault/ # π Encrypted sensitive data (Ansible Vault)
β
βββ π Application Roles
β βββ roles/
β βββ common/ # Shared tasks and configurations
β βββ excalidraw/ # Excalidraw whiteboard
β βββ homer/ # Homer dashboard
β βββ ollama/ # Ollama LLM engine
β βββ open_webui/ # Open WebUI interface
β βββ planka/ # Planka project management
β βββ postgres/ # PostgreSQL database
β β
β βββ Each role contains:
β βββ tasks/
β β βββ main.yml # Deployment tasks
β β βββ uninstall.yml # Cleanup tasks
β βββ vars/main.yml # Role-specific variables
β βββ templates/ # Configuration templates
β
βββ π Documentation
β βββ docs/
β βββ OPEN_WEBUI_CONFIGURATION.md # Open WebUI setup guide
β βββ QUICK_START_OLLAMA.md # Quick start for AI features
β βββ examples/ # Configuration examples
β
βββ π οΈ Utilities & Scripts
β βββ scripts/
β β βββ test-ollama-connection.sh # Test Ollama API
β βββ requirements.txt # Python dependencies
β βββ requirements.yml # Ansible collections
β
βββ βοΈ Infrastructure as Code
β βββ github/ # Terraform for GitHub repo management
β βββ main.tf
β βββ providers.tf
β βββ variables.tf
β βββ ...
β
βββ π§ Development Tools
β βββ .pre-commit-config.yaml # Pre-commit hooks configuration
β βββ .vscode/ # VSCode workspace settings
β βββ .gitignore
β
βββ π Project Files
βββ README.md # This file
βββ LICENSE # MIT License
| Directory | Purpose |
|---|---|
roles/ |
Contains Ansible roles for each application (modular architecture) |
group_vars/all/ |
Global configuration variables and deployment settings |
group_vars/all/vault/ |
Encrypted secrets (passwords, API keys) using Ansible Vault |
docs/ |
Detailed documentation and configuration guides |
scripts/ |
Helper scripts for testing and maintenance |
github/ |
Terraform configurations for managing GitHub infrastructure |
- Quick Start: Ollama + Open WebUI - Get started quickly with Ollama and Open WebUI
- Open WebUI Configuration - Detailed configuration options for Open WebUI
- Configuration Examples - Example configuration files
The Ollama integration includes:
- Automatic GPU support detection and configuration
- Automatic CLI extraction from container for local usage
- Profile script for easy CLI access via
ollama-localcommand - Health checks to ensure the API is ready
For GPU acceleration, ensure the NVIDIA Container Toolkit is installed and the ollama_use_gpu variable is set to true in your configuration.
Open WebUI needs to communicate with Ollama. The connection URL can be configured in two ways:
Option 1: Via container name (recommended)
# In group_vars/all/main.yml
open_webui_ollama_base_url: "http://ollama:11434"Option 2: Via host (current default)
# In roles/open_webui/vars/main.yml
open_webui_ollama_base_url: "http://127.0.0.1:11434/"For detailed configuration options and troubleshooting, see Open WebUI Configuration Guide.
The project includes Terraform configurations to manage GitHub repositories in the github/ directory:
- Change to the GitHub directory:
cd github- Initialize Terraform:
terraform init- Deploy the infrastructure:
terraform applyThis project follows best practices for Infrastructure as Code with comprehensive quality checks.
The project uses pre-commit to ensure code quality. Install hooks after cloning:
pre-commit installAll of these run automatically on commit:
| Tool | Purpose | Files Checked |
|---|---|---|
| π Ansible Lint | Enforces Ansible best practices | *.yml playbooks and roles |
| π YAML Lint | Validates YAML syntax and formatting | *.yml, *.yaml |
| π‘οΈ ShellCheck | Identifies issues in shell scripts | *.sh |
| π§ Terraform fmt | Formats Terraform files | *.tf |
| π§ Terraform validate | Validates Terraform syntax | *.tf |
| π§ TFLint | Lints Terraform configurations | *.tf |
| π Flake8 | Python code linter | *.py |
| π Vault Check | Ensures sensitive files are encrypted | vault/* |
| βοΈ Trailing Whitespace | Removes trailing whitespace | All files |
| π EOF Fixer | Ensures files end with newline | All files |
# Run pre-commit checks manually
pre-commit run --all-files
# Test Ollama connection
bash scripts/test-ollama-connection.sh
# Validate Ansible syntax
ansible-playbook deploy.yml --syntax-check
# Check what would change (dry run)
ansible-playbook deploy.yml --check --diff- Create a new role in
roles/<app_name>/ - Define variables in
roles/<app_name>/vars/main.yml - Create deployment tasks in
roles/<app_name>/tasks/main.yml - Create uninstall tasks in
roles/<app_name>/tasks/uninstall.yml - Add role to
deploy.ymlwith appropriate conditions and tags - Add uninstall task to
uninstall.yml - Update documentation
Example role structure:
roles/myapp/
βββ tasks/
β βββ main.yml # Deployment logic
β βββ uninstall.yml # Cleanup logic
βββ vars/
β βββ main.yml # App-specific variables
βββ templates/
βββ config.yml.j2 # Configuration templates (if needed)
Docker Permission Denied
Problem: permission denied while trying to connect to the Docker daemon socket
Solution:
# Add your user to the docker group
sudo usermod -aG docker $USER
# Log out and back in for changes to take effect
# Or use: newgrp docker
# Verify
docker psAnsible Vault Password Error
Problem: ERROR! Attempting to decrypt but no vault secrets found
Solution:
# Ensure the vault password file exists
ls -la ~/Workspace/.vault/.vault_password
# Create if missing
mkdir -p ~/Workspace/.vault
echo "your-vault-password" > ~/Workspace/.vault/.vault_password
chmod 600 ~/Workspace/.vault/.vault_password
# Verify path in ansible.cfg
grep vault_password_file ansible.cfgOllama GPU Not Working
Problem: Ollama not using GPU acceleration
Solution:
# 1. Install NVIDIA Container Toolkit
# Follow: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html
# 2. Verify installation
docker info | grep -i nvidia
# 3. Enable GPU in configuration
# Edit roles/ollama/vars/main.yml
ollama_use_gpu: true
# 4. Redeploy
ansible-playbook deploy.yml --tags "ollama"Port Already in Use
Problem: Error: bind: address already in use
Solution:
# Find what's using the port (example for port 8080)
sudo lsof -i :8080
# or
sudo netstat -tulpn | grep :8080
# Option 1: Stop the conflicting service
# Option 2: Change port in roles/<app>/vars/main.yml
# Example: open_webui_port: 8081
# Redeploy
ansible-playbook deploy.yml --tags "open_webui"Open WebUI Can't Connect to Ollama
Problem: Open WebUI shows "Cannot connect to Ollama"
Solution:
# 1. Verify Ollama is running
docker ps | grep ollama
# 2. Test Ollama API
curl http://localhost:11434/api/version
# 3. Check Open WebUI configuration
# Edit roles/open_webui/vars/main.yml
open_webui_ollama_base_url: "http://ollama:11434" # Use container name
# or
open_webui_ollama_base_url: "http://127.0.0.1:11434" # Use host
# 4. Redeploy Open WebUI
ansible-playbook deploy.yml --tags "open_webui"Pre-commit Hooks Failing
Problem: Pre-commit hooks prevent commits
Solution:
# Run pre-commit manually to see errors
pre-commit run --all-files
# Update hooks to latest version
pre-commit autoupdate
# If you need to skip hooks temporarily (not recommended)
git commit --no-verify -m "message"If you encounter issues not covered here:
-
Check the logs:
# Ansible output ansible-playbook deploy.yml -vvv # Docker container logs docker logs <container_name>
-
Search existing issues: GitHub Issues
-
Create a new issue: Provide details about your environment, error messages, and steps to reproduce
Contributions are welcome and appreciated! This project benefits from community involvement.
-
Fork the repository
# Click "Fork" on GitHub, then: git clone https://github.com/YOUR-USERNAME/local-projects.git cd local-projects
-
Create a feature branch
git checkout -b feature/amazing-feature
-
Make your changes
- Add a new application role
- Improve documentation
- Fix bugs
- Enhance existing features
-
Test your changes
# Run pre-commit checks pre-commit run --all-files # Test deployment ansible-playbook deploy.yml --check
-
Commit your changes
git add . git commit -m "feat: add amazing feature"
Follow Conventional Commits format:
feat:- New featuresfix:- Bug fixesdocs:- Documentation changesrefactor:- Code refactoringtest:- Adding testschore:- Maintenance tasks
-
Push and create Pull Request
git push origin feature/amazing-feature
Then create a Pull Request on GitHub
- π¦ Add new application roles (Portainer, Grafana, etc.)
- π Improve documentation
- π Fix bugs or improve error handling
- β¨ Enhance existing features
- π§ͺ Add tests
- π¨ Improve UI/UX of configurations
- Be respectful and inclusive
- Provide constructive feedback
- Focus on what is best for the community
This project is licensed under the MIT License - see the LICENSE file for details.
- β Commercial use
- β Modification
- β Distribution
- β Private use
β οΈ No liabilityβ οΈ No warranty
β If this project helped you, please consider giving it a star! β