
Installing OpenStack DevStack on Ubuntu
OpenStack DevStack is a rapid development and prototyping environment that gets you running OpenStack in minutes rather than days or weeks. If you’re looking to dive into OpenStack development, test configurations, or just want to understand how this massive cloud computing platform works under the hood, DevStack is your best friend. This guide will walk you through the complete installation process on Ubuntu, covering everything from system requirements to troubleshooting those inevitable hiccups that’ll make you question your life choices.
What is OpenStack DevStack and How It Works
DevStack is essentially a collection of shell scripts that automate the installation and configuration of OpenStack services. Think of it as the quick-and-dirty way to get a fully functional OpenStack cloud running on a single machine or a small cluster. Unlike production deployments that require careful planning and multiple nodes, DevStack throws everything onto one box and configures it to work together.
The magic happens through a series of bash scripts that download, configure, and start OpenStack services like Nova (compute), Neutron (networking), Glance (image service), Keystone (identity), and Horizon (dashboard). It creates a complete cloud environment where you can launch instances, manage networks, and basically do everything you’d expect from a cloud platform.
Here’s what makes DevStack particularly useful:
- Gets you from zero to OpenStack in under an hour
- Perfect for development and testing scenarios
- Highly configurable through local.conf files
- Supports both single-node and multi-node deployments
- Automatically handles service dependencies and configurations
System Requirements and Prerequisites
Before jumping in, let’s talk hardware and software requirements. DevStack is resource-hungry, so don’t expect this to run smoothly on your old laptop from 2015.
Component | Minimum | Recommended | Notes |
---|---|---|---|
RAM | 8 GB | 16 GB+ | More RAM = more concurrent VMs |
CPU Cores | 4 cores | 8+ cores | Virtualization extensions required |
Storage | 60 GB | 100 GB+ | SSD strongly recommended |
Network | 1 interface | 2+ interfaces | Additional interfaces for advanced networking |
Ubuntu version compatibility is crucial. DevStack officially supports the latest LTS releases and the most recent stable version. As of writing, Ubuntu 22.04 LTS (Jammy) and Ubuntu 20.04 LTS (Focal) work best.
Step-by-Step Installation Guide
Time to get our hands dirty. This installation assumes you’re starting with a fresh Ubuntu installation. If you’re using an existing system, be aware that DevStack will modify network configurations and install numerous packages.
Step 1: System Preparation
First, update your system and install essential packages:
sudo apt update && sudo apt upgrade -y
sudo apt install -y git python3-pip python3-dev libffi-dev gcc libssl-dev
Create a dedicated user for DevStack. Never run DevStack as root – it’s a security nightmare and the scripts will refuse to run anyway:
sudo adduser --disabled-password --gecos "" stack
sudo usermod -aG sudo stack
echo "stack ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/stack
Switch to the stack user:
sudo su - stack
Step 2: Download DevStack
Clone the DevStack repository. Always use the stable branch unless you enjoy debugging bleeding-edge bugs at 2 AM:
git clone https://opendev.org/openstack/devstack
cd devstack
git checkout stable/yoga
The branch name corresponds to OpenStack releases. Popular stable branches include yoga, xena, and wallaby. Check the official DevStack documentation for current supported versions.
Step 3: Configuration Setup
Create the local.conf file – this is where the magic happens. This file controls which services get installed and how they’re configured:
cat > local.conf << EOF
[[local|localrc]]
# Password for KeyStone, Database, RabbitMQ and Service
ADMIN_PASSWORD=secretadmin
DATABASE_PASSWORD=secretdatabase
RABBIT_PASSWORD=secretrabbit
SERVICE_PASSWORD=secretservice
# Host IP - change this to your actual IP
HOST_IP=192.168.1.100
# Logging
LOGFILE=/opt/stack/logs/stack.sh.log
VERBOSE=True
LOG_COLOR=True
SCREEN_LOGDIR=/opt/stack/logs
# Core Services
enable_service rabbit mysql key
# Nova Services
enable_service n-api n-cpu n-cond n-sch n-novnc n-cauth
# Glance Service
enable_service g-api g-reg
# Neutron Services
enable_service q-svc q-agt q-dhcp q-l3 q-meta neutron
# Horizon Dashboard
enable_service horizon
# Cinder Services (optional)
enable_service cinder c-api c-vol c-sch
EOF
Replace HOST_IP with your actual machine's IP address. You can find it with:
ip addr show | grep inet | grep -v 127.0.0.1
Step 4: Run the Installation
Now for the moment of truth. The installation process typically takes 30-60 minutes depending on your internet connection and hardware:
./stack.sh
Grab a coffee, watch the logs scroll by, and pray to whatever deity oversees distributed systems. The script will download gigabytes of packages, configure databases, set up networking, and start all the services.
If everything goes well, you'll see output similar to:
=========================
DevStack Component Timing
=========================
Total runtime 1618 seconds
run_process 46 seconds
test_with_retry 5 seconds
apt-get-update 6 seconds
...
This is your host IP address: 192.168.1.100
This is your host IPv6 address: ::1
Horizon is now available at http://192.168.1.100/dashboard
Keystone is serving at http://192.168.1.100/identity/
The default users are: admin and demo
The password: secretadmin
Verification and First Steps
Time to verify everything actually works. Open your web browser and navigate to the Horizon dashboard at the IP address shown in the installation output.
Login with:
- Username: admin
- Password: secretadmin (or whatever you set in local.conf)
- Domain: Default
You can also test the command-line interface. Source the admin credentials and run some basic commands:
source openrc admin admin
openstack service list
openstack compute service list
openstack network list
Create your first instance to really verify everything's working:
# Create a tiny flavor if it doesn't exist
openstack flavor create --ram 512 --disk 1 --vcpus 1 m1.nano
# Download a test image
wget http://download.cirros-cloud.net/0.5.2/cirros-0.5.2-x86_64-disk.img
# Upload the image to Glance
openstack image create "cirros" --file cirros-0.5.2-x86_64-disk.img --disk-format qcow2 --container-format bare --public
# Launch an instance
openstack server create --flavor m1.nano --image cirros --network private test-instance
Common Issues and Troubleshooting
DevStack installations fail for various reasons. Here are the most common issues and their solutions:
Memory and Disk Space Issues
If you see errors about insufficient memory or disk space, DevStack might be trying to do too much with too little. Edit your local.conf to disable some services:
# Disable Cinder if you don't need block storage
disable_service cinder c-api c-vol c-sch
# Disable Swift if you don't need object storage
disable_service swift s-proxy s-object s-container s-account
Network Configuration Problems
Network issues are probably the most frustrating. If instances can't get IP addresses or you can't reach the dashboard:
# Check if the bridge interface exists
ip addr show br-ex
# Restart networking services
sudo systemctl restart devstack@q-*
# Check Neutron agent status
openstack network agent list
Database Connection Errors
MySQL connection issues often stem from password mismatches or service startup problems:
# Check MySQL status
sudo systemctl status mysql
# Restart MySQL if needed
sudo systemctl restart mysql
# Verify database credentials
mysql -u root -psecretdatabase -e "show databases;"
Service Startup Failures
Individual services might fail to start. Use screen to check service logs:
# List running screen sessions
screen -ls
# Attach to a specific service screen
screen -r stack
# Navigate between windows with Ctrl+A then number keys
# Check logs in /opt/stack/logs/ for detailed error messages
Real-World Use Cases and Applications
DevStack shines in several scenarios where you need OpenStack functionality without the complexity of a full production deployment:
Development and Testing
If you're developing OpenStack-related applications or contributing to the OpenStack project itself, DevStack provides a consistent environment for testing. You can rapidly iterate on code changes, test new features, and validate API interactions without affecting production systems.
Learning and Training
DevStack is perfect for educational purposes. Students and professionals can explore OpenStack architecture, understand service interactions, and practice cloud administration tasks. Many OpenStack certification programs recommend DevStack for hands-on practice.
Proof of Concept Deployments
When evaluating OpenStack for organizational use, DevStack provides a quick way to demonstrate capabilities. You can show stakeholders the dashboard, launch instances, configure networks, and showcase cloud features without investing in hardware or complex installations.
CI/CD Integration Testing
DevStack integrates well with continuous integration pipelines. Many projects use DevStack environments to test application deployments against OpenStack APIs, validate Terraform configurations, or verify cloud-init scripts.
Comparison with Alternatives
DevStack isn't the only game in town for getting OpenStack running quickly. Here's how it compares to alternatives:
Solution | Installation Time | Resource Usage | Production Ready | Best For |
---|---|---|---|---|
DevStack | 30-60 minutes | High | No | Development, testing, learning |
MicroStack | 15-30 minutes | Medium | Edge cases | Quick demos, edge computing |
Kolla-Ansible | 2-4 hours | High | Yes | Production deployments |
OpenStack-Helm | 3-6 hours | Variable | Yes | Kubernetes-based deployments |
TripleO | 4-8 hours | Very High | Yes | Large-scale production |
MicroStack, developed by Canonical, offers faster installation through snap packages but with less flexibility. For production environments, Kolla-Ansible or OpenStack-Helm provide better stability and operational features.
Best Practices and Performance Optimization
Getting DevStack running is one thing; getting it running well is another. Here are some tips to optimize your installation:
Resource Management
Configure appropriate quotas to prevent resource exhaustion:
# Set reasonable quotas for the demo project
openstack quota set --instances 10 --cores 20 --ram 20480 demo
openstack quota set --volumes 10 --gigabytes 100 demo
Storage Optimization
If you're using Cinder, configure it to use a dedicated disk or logical volume instead of file-based storage:
# Add to local.conf for better Cinder performance
CINDER_ENABLED_BACKENDS=lvm:lvmdriver-1
VOLUME_GROUP="stack-volumes-lvmdriver-1"
VOLUME_NAME_PREFIX="volume-"
VOLUME_BACKING_FILE_SIZE=50G
Network Performance
For better network performance, especially with multiple instances, consider using SR-IOV or OVS with DPDK if your hardware supports it:
# Enable OVS firewall driver for better performance
[[post-config|$NEUTRON_CONF]]
[securitygroup]
firewall_driver = openvswitch
Logging and Monitoring
Set up proper logging to troubleshoot issues quickly:
# Add centralized logging configuration
[[post-config|$NOVA_CONF]]
[DEFAULT]
debug = True
verbose = True
log_dir = /opt/stack/logs
[[post-config|$NEUTRON_CONF]]
[DEFAULT]
debug = True
verbose = True
log_file = /opt/stack/logs/neutron.log
Advanced Configuration and Multi-Node Setup
Once you're comfortable with single-node DevStack, you might want to explore multi-node configurations. This requires additional local.conf customization and network planning.
For a compute node joining an existing controller, use this local.conf template:
[[local|localrc]]
DATABASE_PASSWORD=secretdatabase
RABBIT_PASSWORD=secretrabbit
SERVICE_PASSWORD=secretservice
SERVICE_HOST=192.168.1.100 # Controller IP
MYSQL_HOST=$SERVICE_HOST
RABBIT_HOST=$SERVICE_HOST
GLANCE_HOSTPORT=$SERVICE_HOST:9292
# Compute node only runs nova-compute
ENABLED_SERVICES=n-cpu,rabbit,neutron,q-agt
# Networking
PHYSICAL_NETWORK=default
OVS_PHYSICAL_BRIDGE=br-ex
PUBLIC_INTERFACE=eth1
Multi-node setups require careful network planning and consistent configuration across nodes. The DevStack multi-node guide provides detailed instructions for complex topologies.
Security Considerations
DevStack prioritizes ease of use over security, making it unsuitable for production. However, you should still follow basic security practices:
- Use strong, unique passwords in local.conf
- Run DevStack in isolated environments or VMs
- Don't expose DevStack services to public networks
- Regularly update the DevStack repository and underlying OS
- Use firewall rules to restrict access to OpenStack service ports
For development environments handling sensitive data, consider additional hardening measures like enabling TLS for API endpoints and implementing proper access controls.
Maintenance and Updates
DevStack environments are typically ephemeral, but you might need to update or maintain them for longer periods:
# Update DevStack repository
cd /opt/stack/devstack
git pull origin stable/yoga
# Clean and rebuild (destroys all data)
./clean.sh
./stack.sh
# Restart services without rebuilding
./rejoin-stack.sh
The clean.sh script removes all OpenStack data and configurations, essentially returning you to a fresh state. Use it when you need to start over or when updates require a clean installation.
DevStack has become the de facto standard for OpenStack development and testing environments. While it's not suitable for production workloads, its speed and flexibility make it invaluable for developers, students, and anyone wanting to understand OpenStack architecture. The installation process, while occasionally frustrating, provides valuable insights into OpenStack's complexity and the interdependencies between its various services.
Remember that DevStack environments are meant to be disposable. Don't get too attached to your instances or data - embrace the cattle-not-pets philosophy and use DevStack as a learning and development tool rather than a permanent infrastructure solution.

This article incorporates information and material from various online sources. We acknowledge and appreciate the work of all original authors, publishers, and websites. While every effort has been made to appropriately credit the source material, any unintentional oversight or omission does not constitute a copyright infringement. All trademarks, logos, and images mentioned are the property of their respective owners. If you believe that any content used in this article infringes upon your copyright, please contact us immediately for review and prompt action.
This article is intended for informational and educational purposes only and does not infringe on the rights of the copyright owners. If any copyrighted material has been used without proper credit or in violation of copyright laws, it is unintentional and we will rectify it promptly upon notification. Please note that the republishing, redistribution, or reproduction of part or all of the contents in any form is prohibited without express written permission from the author and website owner. For permissions or further inquiries, please contact us.