DEV Community

Cover image for How I Built Our Own OpenStack Cloud on a Virtual Machine (Step-by-Step Guide)
P0Saurabh
P0Saurabh

Posted on

How I Built Our Own OpenStack Cloud on a Virtual Machine (Step-by-Step Guide)

πŸ“ Introduction:

OpenStack is one of the most popular open-source platforms used to build private cloud infrastructure β€” imagine running your own version of AWS πŸ—οΈ right on your personal machine πŸ’».

I wanted to dive deeper into cloud computing, so I decided to set up my own OpenStack cloud using MicroStack β€” a simplified, single-node version of OpenStack.

In this blog, I’ll walk you through everything I did β€” step-by-step β€” from setting up the system to launching a virtual machine through the OpenStack Dashboard 🌐.

Whether you're using Windows πŸͺŸ, macOS 🍎, or Linux 🐧, this guide will help you get your own private cloud up and running locally.

πŸ” What we’ll cover:

βœ… System setup (based on your OS)
βœ… Installing OpenStack using MicroStack
βœ… Uploading a cloud image
βœ… Launching your first VM from the Horizon dashboard

🧰 Prerequisites (Cross-Platform Setup)
You can follow this guide on any operating system, but make sure your system meets these minimum requirements:

βš™οΈ Minimum System Requirements:

🧠 CPU: 4 or more cores
🧡 RAM: Minimum 16 GB
πŸ’Ύ Storage: At least 100 GB free
🌐 Internet: Required

πŸ”§ Step 2: Set Up the Virtual Machine and Install Ubuntu 20.04 LTS

To run OpenStack using MicroStack, we need a Linux environment. If you're not already on Ubuntu, follow these instructions to install it inside a virtual machine on your system.

πŸ’» VM Setup Instructions (For Windows and macOS Users)
You'll need to create a virtual machine using either:

🧱 VirtualBox (Free and open source)
πŸ’Ό VMware Workstation Player (Free for personal use)
🍏 UTM or Parallels Desktop (macOS)

βš™οΈ Recommended VM Configuration:
Setting Value
CPU 4 cores
RAM 16 GB
Storage 100 GB (dynamically allocated is OK)
Network Mode Bridged Adapter 🌐
OS ISO Ubuntu 20.04.6 LTS (64-bit) 🐧

πŸ“₯ Download Ubuntu 20.04 LTS ISO
Go to the official site and download the ISO:
πŸ”— https://releases.ubuntu.com/20.04/
Make sure to choose the 64-bit Desktop image.

πŸ›  Create and Install the VM

  1. Open VirtualBox or your VM tool of choice (e.g., VMware, UTM, Parallels).

  2. Create a new VM and choose:

    • πŸ–₯️ OS Type: Linux
    • 🧩 Version: Ubuntu (64-bit)
  3. Attach the Ubuntu ISO you downloaded earlier.

  4. Start the VM and follow the installation prompts:

    • βœ… Select "Erase disk and install Ubuntu"
    • 🧠 Choose your keyboard layout, language, and timezone
    • πŸ‘€ Set up a username and password (you'll use this to log in later)
  5. After installation completes, restart the VM.

  6. Once logged into Ubuntu, open the terminal with Ctrl + Alt + T and you're ready to continue!

☁️ Step 3: Installing MicroStack (Single-Node OpenStack Setup)

MicroStack is a snap-based deployment of OpenStack developed by Canonical. It allows you to run a full OpenStack cloud on a single machine β€” ideal for local testing, learning, and labs.

πŸ”§ What’s Included with MicroStack?

When installed, MicroStack sets up the following OpenStack services automatically:

  • πŸ” Keystone – Identity service
  • 🧠 Nova – Compute service (virtual machines)
  • πŸ–ΌοΈ Glance – Image service
  • 🌐 Neutron – Networking service
  • πŸ“¦ Cinder – Block storage
  • 🌍 Horizon – Web-based dashboard

πŸ“¦ Step-by-Step MicroStack Installation

Make sure your Ubuntu VM is running and you’re logged into your user account.

Absolutely! Here's the correct and properly structured Markdown version of the section, formatted cleanly for use in a blog or documentation platform:


βœ… 1. Update Your System

```

bash
sudo apt update && sudo apt upgrade -y

Enter fullscreen mode Exit fullscreen mode

βœ… 2. Install Snap


bash
sudo apt install snapd -y

Enter fullscreen mode Exit fullscreen mode

βœ… 3. Install MicroStack (Edge Channel + Dev Mode)


bash
sudo snap install microstack --edge --devmode

Enter fullscreen mode Exit fullscreen mode

βœ… 4. Initialize MicroStack as a Control Node


bash
sudo microstack init --auto --control

Enter fullscreen mode Exit fullscreen mode

This command will:

  • πŸ”‘ Generate SSL keys
  • βš™οΈ Set up essential services like MySQL, RabbitMQ, Nova, Keystone
  • 🌐 Configure networking
  • πŸ“¦ Download and register a test image (CirrOS)
  • 🟒 Create default flavors and networks > πŸ• This step can take 10–15 minutes depending on your system.

πŸ” How to Get the OpenStack Admin Password and Access the Dashboard

After installing MicroStack, your OpenStack admin credentials are saved automatically in a file.


βœ… Get the Admin Password

Run the following command in your terminal:


bash
cat /var/snap/microstack/common/etc/microstack.rc


Enter fullscreen mode Exit fullscreen mode

You’ll see output like this:



export OS_PROJECT_DOMAIN_NAME=default
export OS_USER_DOMAIN_NAME=default
export OS_PROJECT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=your_actual_password_here
export OS_AUTH_URL=https://<your-vm-ip>:5000/v3
...


Enter fullscreen mode Exit fullscreen mode

πŸ”‘ Copy the value of:


bash
export OS_PASSWORD=your_actual_password_here


Enter fullscreen mode Exit fullscreen mode

That’s your OpenStack admin password.

🌐 Access the OpenStack Dashboard (Horizon)

βœ… 1. Find Your VM's IP Address

Run:


bash
ip a


Enter fullscreen mode Exit fullscreen mode

Look for the IP address under your main network interface (usually enp0s3 or eth0), for example:



192.168.1.101


Enter fullscreen mode Exit fullscreen mode

βœ… 2. Open Horizon Dashboard in Your Browser

In your host machine’s browser, visit:



http://<your-vm-ip>


Enter fullscreen mode Exit fullscreen mode

Example:


http://192.168.1.101

Enter fullscreen mode Exit fullscreen mode

πŸ“Œ Make sure your VM uses Bridged Adapter mode in VirtualBox or VMware so it's accessible on your local network.

βœ… 3. Log In

Username: admin
Password: The value you copied from the .rc file (OS_PASSWORD)

Image description

πŸ–ΌοΈ Step 5: Upload a Cloud Image Manually in Horizon Dashboard

Now that you’re logged into the OpenStack Horizon dashboard, let’s upload a cloud image so you can launch your first virtual machine.


βœ… What Image Do You Need?

OpenStack supports various formats, but the most commonly used is QCOW2.

We’ll use the Ubuntu 20.04 Cloud image.

πŸ“₯ Download it from:

https://cloud-images.ubuntu.com/focal/current/

Download the file named:focal-server-cloudimg-amd64.img


🧭 Upload the Image via Horizon (Web UI)

  1. Go to the Project tab on the left sidebar.
  2. Click Compute β†’ Images.

  3. Click the "Create Image" button (top-right).

Image description

Fill the form as follows:

Field Value
Image Name ubuntu-focal
Image Source Image File
Format QCOW2 - QEMU Emulator
Architecture x86_64
Minimum Disk (GB) 10
Minimum RAM (MB) 2048
File Choose the focal-server-cloudimg-amd64.img you downloaded

Image description

Click Create Image.

βœ… The image will now be uploaded and processed. Once completed, it will appear in the Images list.

🎯 Final Thoughts: Your OpenStack Cloud Is Now Live!

Congratulations! πŸŽ‰ We’ve successfully built your very own OpenStack cloud environment β€” from setting up a VM, installing MicroStack, uploading an image, and launching your first instance. This experience gives you real insight into how modern cloud platforms work under the hood.

But our journey doesn’t stop here β€” OpenStack is made up of many powerful components, each handling a key part of the cloud ecosystem.


🧩 Key OpenStack Services You Just Used

Here’s a quick overview of the main services you interacted with:

Service Name Description
🌐 Horizon horizon The web-based dashboard used to manage and monitor OpenStack resources.
πŸ” Keystone keystone Handles identity, authentication, and role-based access across OpenStack.
🧠 Nova nova The compute engine that launches and manages virtual machines (instances).
πŸ–ΌοΈ Glance glance Manages VM images. You uploaded your Ubuntu image here.
🌐 Neutron neutron Provides networking-as-a-service, including IP management, subnets, and routers.
πŸ“¦ Cinder cinder Offers block storage for VMs (volumes that can persist after reboots).
🐧 Cloud-Init (helper tool) Initializes cloud images on first boot (sets SSH keys, usernames, etc.).

πŸš€ What We Can Try Next

  • Create and attach volumes using Cinder.
  • Set up floating IPs for external SSH access.
  • Create security groups and custom rules.
  • Explore OpenStack CLI for scripting and automation.
  • Test multi-instance deployment and scaling.

πŸ’¬ Wrap-Up

Building our own cloud gives you hands-on experience with how real-world infrastructure runs. Whether you're a student, DevOps engineer, or curious learner, running OpenStack locally is a massive step forward in understanding cloud-native technologies.

Thanks for reading!

Feel free to share, comment, or ask questions if you get stuck anywhere. Happy hacking! πŸ˜„β˜οΈ

Top comments (0)