Tutorial

How to Install OpenStack on Ubuntu 18.04 with DevStack

Published on August 3, 2022
author

Pankaj

How to Install OpenStack on Ubuntu 18.04  with DevStack

Openstack is a free and opensource IaaS cloud platform that handles cloud compute, storage and network resources. It comes with an intuitive dashboard that enables systems administrators to provide and monitor these resources. You can seamlessly install OpenStack locally on your Ubuntu 18.04 instance for learning and testing purposes using Devstack. Devstack is a set of extensible scripts that facilitate OpenStack deployment. In this guide, you will learn how to deploy OpenStack on Ubuntu 18.04 with devstack.

Minimum Requirements

Before we begin, ensure you have the following minimum prerequisites

  1. A fresh Ubuntu 18.04 installation
  2. User with sudo privileges
  3. 4 GB RAM
  4. 2 vCPUs
  5. Hard disk capacity of 10 GB
  6. Internet connection

With the minimum requirements satisfied, we can now proceed.

Step 1: Update and Upgrade the System

To start off, log into your Ubuntu 18.04 system using SSH protocol and update & upgrade system repositories using the following command.

apt update -y && apt upgrade -y

Sample Output Update And Upgrade Ubuntu 18 04 Bionic Beaver Next reboot the system using the command.

sudo reboot

OR

init 6

Step 2: Create Stack user and assign sudo priviledge

Best practice demands that devstack should be run as a regular user with sudo privileges. With that in mind, we are going to add a new user called “stack” and assign sudo privileges. To create stack user execute

sudo adduser -s /bin/bash -d /opt/stack -m stack

Next, run the command below to assign sudo privileges to the user

echo "stack ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/stack

Sample Output Add Stack User And Assign Sudo Privileges

Step 3: Install git and download DevStack

Once you have successfully created the user ‘stack’ and assigned sudo privileges, switch to the user using the command.

su - stack

In most Ubuntu 18.04 systems, git comes already installed. If by any chance git is missing, install it by running the following command.

sudo apt install git -y

Sample output Switch To Stack User And Install Git Using git, clone devstack’s git repository as shown.

git clone https://git.openstack.org/openstack-dev/devstack

Sample output Deploy Devstack

Step 4: Create devstack configuration file

In this step, navigate to the devstack directory.

cd devstack

Then create a local.conf configuration file.

vim local.conf

Paste the following content

[[local|localrc]]

# Password for KeyStone, Database, RabbitMQ and Service
ADMIN_PASSWORD=StrongAdminSecret
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD

# Host IP - get your Server/VM IP address from ip addr command
HOST_IP=10.208.0.10

Save and exit the text editor. NOTE:

  1. The ADMIN_PASSWORD is the password that you will use to log in to the OpenStack login page. The default username is admin.
  2. The HOST_IP is your system’s IP address that is obtained by running ifconfig or ip addr commands.

Step 5: Install OpenStack with Devstack

To commence the installation of OpenStack on Ubuntu 18.04, run the script below contained in devstack directory.

./stack.sh

The following features will be installed:

  • Horizon – OpenStack Dashboard
  • Nova – Compute Service
  • Glance – Image Service
  • Neutron – Network Service
  • Keystone – Identity Service
  • Cinder – Block Storage Service
  • Placement – Placement API

The deployment takes about 10 to 15 minutes depending on the speed of your system and internet connection. In our case, it took roughly 12 minutes. At the very end, you should see output similar to what we have below. Devstack Installed This confirms that all went well and that we can proceed to access OpenStack via a web browser.

Step 6: Accessing OpenStack on a web browser

To access OpenStack via a web browser browse your Ubuntu’s IP address as shown. https://server-ip/dashboard This directs you to a login page as shown. Openstack login page Enter the credentials and hit “Sign In” You should be able to see the Management console dashboard as shown below. Openstack Admin Dashboard For more on Devstack’s customization, check out their system configuration guide. Additionally, check out the Openstack documentation for administration guide.

Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.

Learn more about our products

About the author(s)

Category:
Tutorial

While we believe that this content benefits our community, we have not yet thoroughly reviewed it. If you have any suggestions for improvements, please let us know by clicking the “report an issue“ button at the bottom of the tutorial.

Still looking for an answer?

Ask a questionSearch for more help

Was this helpful?
 
JournalDev
DigitalOcean Employee
DigitalOcean Employee badge
December 31, 2019

Step 2 should be useradd instead of adduser.

- Lester Carrejo

    JournalDev
    DigitalOcean Employee
    DigitalOcean Employee badge
    January 26, 2020

    Hello, I am installing openstack on ubuntu 18.04 and this command that su recommend do not work – sudo adduser -s /bin/bash -d /opt/stack -m stack

    - Ricardo Mejias

    JournalDev
    DigitalOcean Employee
    DigitalOcean Employee badge
    January 26, 2020

    what’s the error you are getting?

    - Pankaj

    JournalDev
    DigitalOcean Employee
    DigitalOcean Employee badge
    April 15, 2020

    good evening master ,please help me ! I´m trying to install devstack ,almost everything install well but at the end i receive this erros message =============================================================================== log end ================================================================================ ERROR: could not install deps [-chttps://releases.openstack.org/constraints/upper/master, -r/opt/stack/tempest/requirements.txt, -r/opt/stack/tempest/doc/requirements.txt]; v = InvocationError(‘/opt/stack/tempest/.tox/venv/bin/pip install -chttps://releases.openstack.org/constraints/upper/master -r/opt/stack/tempest/requirements.txt -r/opt/stack/tempest/doc/requirements.txt’, 1) _______________________________________________________________________________ summary ________________________________________________________________________________ ERROR: venv: could not install deps [-chttps://releases.openstack.org/constraints/upper/master, -r/opt/stack/tempest/requirements.txt, -r/opt/stack/tempest/doc/requirements.txt]; v = InvocationError(‘/opt/stack/tempest/.tox/venv/bin/pip install -chttps://releases.openstack.org/constraints/upper/master -r/opt/stack/tempest/requirements.txt -r/opt/stack/tempest/doc/requirements.txt’, 1) +lib/tempest:configure_tempest:1 exit_trap +./stack.sh:exit_trap:533 local r=1 ++./stack.sh:exit_trap:534 jobs -p +./stack.sh:exit_trap:534 jobs= +./stack.sh:exit_trap:537 [[ -n ‘’ ]] +./stack.sh:exit_trap:543 ‘[’ -f /tmp/tmp.1Bomg5c4aS ‘]’ +./stack.sh:exit_trap:544 rm /tmp/tmp.1Bomg5c4aS +./stack.sh:exit_trap:548 kill_spinner +./stack.sh:kill_spinner:443 ‘[’ ‘!’ -z ‘’ ‘]’ +./stack.sh:exit_trap:550 [[ 1 -ne 0 ]] +./stack.sh:exit_trap:551 echo ‘Error on exit’ Error on exit +./stack.sh:exit_trap:553 type -p generate-subunit +./stack.sh:exit_trap:554 generate-subunit 1586976290 6458 fail +./stack.sh:exit_trap:556 [[ -z /opt/stack/logs ]] +./stack.sh:exit_trap:559 /usr/bin/python3.6 /home/stack/devstack/tools/worlddump.py -d /opt/stack/logs World dumping… see /opt/stack/logs/worlddump-2020-04-15-203231.txt for details nova-compute: no process found neutron-dhcp-agent: no process found neutron-l3-agent: no process found neutron-metadata-agent: no process found neutron-openvswitch-agent: no process found +./stack.sh:exit_trap:568 exit 1 stack@ubuntu:~/devstack$ I really do not know what else I can do !!! plz help me, thanks for the attentions.

    - matumona

      JournalDev
      DigitalOcean Employee
      DigitalOcean Employee badge
      December 22, 2020

      Hello pankaj, I am having the below error while running ./stack.sh. command "+./stack.sh:exit_trap:517 /usr/bin/python3.8 /home/kali/devstack/tools/worlddump.py -d /opt/stack/logs/ebtables v1.8.4 (nf_tables): table `broute’ is incompatible, use ‘nft’ tool. nova-compute: no process found

      - Fenil

        JournalDev
        DigitalOcean Employee
        DigitalOcean Employee badge
        January 28, 2020

        +./stack.sh:main:791 echo_summary ‘Installing package prerequisites’ +./stack.sh:echo_summary:452 [[ -t 3 ]] +./stack.sh:echo_summary:452 [[ True != \T\r\u\e ]] +./stack.sh:echo_summary:458 echo -e Installing package prerequisites ++./stack.sh:echo_summary:1 exit_trap ++./stack.sh:exit_trap:533 local r=1 +++./stack.sh:exit_trap:534 jobs -p ++./stack.sh:exit_trap:534 jobs= ++./stack.sh:exit_trap:537 [[ -n ‘’ ]] ++./stack.sh:exit_trap:543 ‘[’ -f ‘’ ‘]’ ++./stack.sh:exit_trap:548 kill_spinner ++./stack.sh:kill_spinner:443 ‘[’ ‘!’ -z ‘’ ‘]’ ++./stack.sh:exit_trap:550 [[ 1 -ne 0 ]] ++./stack.sh:exit_trap:551 echo ‘Error on exit’ ./stack.sh: line 551: echo: write error: Broken pipe

        - amar

          JournalDev
          DigitalOcean Employee
          DigitalOcean Employee badge
          February 6, 2020

          hello, Distro ubuntu 19.10 problem is : ack.sh failed Error on exit World dumping… see /opt/stack/logs/worlddump-2020-02-06-154209.txt for details ebtables v1.8.3 (nf_tables): table `broute’ is incompatible, use ‘nft’ tool. – stack@HP-Z210-Workstation:~/devstack/tools$ cat /opt/stack/logs/worlddump-2020-02-06-154209.txt|grep broute sudo ebtables -t broute -L *** Failed to run ‘sudo ebtables -t broute -L’: Command ‘sudo ebtables -t broute -L’ returned non-zero exit status 1 help me ? NB: apt update -y && apt upgrade -y : executed upgrade , i start directely ubuntu 19.10 desktop

          - Mario

            JournalDev
            DigitalOcean Employee
            DigitalOcean Employee badge
            February 13, 2020

            Error on exit World dumping… see /opt/stack/logs/worlddump-2020-02-06-154209.txt for details ebtables v1.8.3 (nf_tables): table `broute’ is incompatible, use ‘nft’ tool. — stack@HP-Z210-Workstation:~/devstack/tools$ cat /opt/stack/logs/worlddump-2020-02-06-154209.txt|grep broute sudo ebtables -t broute -L *** Failed to run ‘sudo ebtables -t broute -L’: Command ‘sudo ebtables -t broute -L’ returned non-zero exit status 1

            - gouthami

            JournalDev
            DigitalOcean Employee
            DigitalOcean Employee badge
            April 17, 2020

            Try Switching to iptable-legacy apt-get update apt-get upgrade apt-get install iptable apt-get install arptables apt-get install ebtables update-alternatives --set iptables /usr/sbin/iptables-legacy || true update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy || true update-alternatives --set arptables /usr/sbin/arptables-legacy || true update-alternatives --set ebtables /usr/sbin/ebtables-legacy || true for me it worked with debian Buster

            - Gyan

              JournalDev
              DigitalOcean Employee
              DigitalOcean Employee badge
              February 15, 2020

              I got this error in installation time Ubutnu 18.04, please help me anybody env http_proxy= https_proxy= no_proxy= PIP_FIND_LINKS= SETUPTOOLS_SYS_PATH_TECHNIQUE=rewrite /opt/stack/requirements/.venv/bin/pip install -c /opt/stack/requirements/upper-constraints.txt -U pbr env: ‘/opt/stack/requirements/.venv/bin/pip’: No such file or directory +inc/python:pip_install:1 exit_trap +./stack.sh:exit_trap:535 local r=127 ++./stack.sh:exit_trap:536 jobs -p +./stack.sh:exit_trap:536 jobs= +./stack.sh:exit_trap:539 [[ -n ‘’ ]] +./stack.sh:exit_trap:545 ‘[’ -f ‘’ ‘]’ +./stack.sh:exit_trap:550 kill_spinner +./stack.sh:kill_spinner:445 ‘[’ ‘!’ -z ‘’ ‘]’ +./stack.sh:exit_trap:552 [[ 127 -ne 0 ]] +./stack.sh:exit_trap:553 echo ‘Error on exit’ Error on exit +./stack.sh:exit_trap:555 type -p generate-subunit +./stack.sh:exit_trap:556 generate-subunit 1581765591 41 fail +./stack.sh:exit_trap:558 [[ -z /opt/stack/logs ]] +./stack.sh:exit_trap:561 /opt/stack/devstack/tools/worlddump.py -d /opt/stack/logs World dumping… see /opt/stack/logs/worlddump-2020-02-15-112032.txt for details +./stack.sh:exit_trap:570 exit 127

              - Sathish

              JournalDev
              DigitalOcean Employee
              DigitalOcean Employee badge
              March 19, 2020

              Its Working Properly, Thank You so much

              - Sathish

                JournalDev
                DigitalOcean Employee
                DigitalOcean Employee badge
                April 8, 2020

                i have the same erro what is the fix

                - Eric Maye

                  JournalDev
                  DigitalOcean Employee
                  DigitalOcean Employee badge
                  April 6, 2020

                  is not sudo adduser -s /bin/bash -d /opt/stack -m stack, it is : sudo useradd -s /bin/bash -d /opt/stack -m stack

                  - Sam

                    JournalDev
                    DigitalOcean Employee
                    DigitalOcean Employee badge
                    May 8, 2020

                    Even following all the instructions regarding the user stack, I am receiving the error below. Exception: Traceback (most recent call last): File “/opt/stack/requirements/.venv/lib/python3.6/site-packages/pip/basecommand.py”, line 215, in main status = self.run(options, args) File “/opt/stack/requirements/.venv/lib/python3.6/site-packages/pip/commands/install.py”, line 342, in run requirement_set.prepare_files(finder) File “/opt/stack/requirements/.venv/lib/python3.6/site-packages/pip/req/req_set.py”, line 380, in prepare_files ignore_dependencies=self.ignore_dependencies)) File “/opt/stack/requirements/.venv/lib/python3.6/site-packages/pip/req/req_set.py”, line 554, in _prepare_file require_hashes File “/opt/stack/requirements/.venv/lib/python3.6/site-packages/pip/req/req_install.py”, line 281, in populate_link self.link = self._wheel_cache.cached_wheel(self.link, self.name) File “/opt/stack/requirements/.venv/lib/python3.6/site-packages/pip/wheel.py”, line 68, in cached_wheel self._cache_dir, link, self._format_control, package_name) File “/opt/stack/requirements/.venv/lib/python3.6/site-packages/pip/wheel.py”, line 129, in cached_wheel wheel_names = os.listdir(root) PermissionError: [Errno 13] Permission denied: ‘/opt/stack/.cache/pip/wheels/a7/c1/ea/cf5bd31012e735dc1dfea3131a2d5eae7978b251083d6247bd’

                    - Dalton

                    JournalDev
                    DigitalOcean Employee
                    DigitalOcean Employee badge
                    October 21, 2020

                    Did you solve this? How? I’m having the same problem :( Help please.

                    - Wafaa

                      JournalDev
                      DigitalOcean Employee
                      DigitalOcean Employee badge
                      October 30, 2020

                      The directories under /opt/stack should be owned by the user stack. Try running sudo chown -R stack:stack /opt/stack.

                      - Arjun

                      JournalDev
                      DigitalOcean Employee
                      DigitalOcean Employee badge
                      January 5, 2021

                      This is simple permission error, to solve this error please run the below command $sudo chown -R stack:stack /opt/stack or $ sudo chown stack:stack /opt/stack

                      - Akshay Mewada

                        JournalDev
                        DigitalOcean Employee
                        DigitalOcean Employee badge
                        May 28, 2020

                        Hi Pankaj, Greetings! First of all thanks for tutorial. I have one question. How we can login to Openstack CLI mode to practice CLI configuration commands? Thanks

                        - Mujtaba Bashir

                          JournalDev
                          DigitalOcean Employee
                          DigitalOcean Employee badge
                          May 28, 2020

                          Dear Greetings! I tried to install with respective instruction installation goes for around 25 to 35 mins at the end it give exhibit below error and stop. Please guide accordingly ERROR: Cannot uninstall ‘simplejson’. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall. +inc/python:pip_install:1 exit_trap +./stack.sh:exit_trap:489 local r=1 ++./stack.sh:exit_trap:490 jobs -p +./stack.sh:exit_trap:490 jobs= +./stack.sh:exit_trap:493 [[ -n ‘’ ]] +./stack.sh:exit_trap:499 ‘[’ -f ‘’ ‘]’ +./stack.sh:exit_trap:504 kill_spinner +./stack.sh:kill_spinner:399 ‘[’ ‘!’ -z ‘’ ‘]’ +./stack.sh:exit_trap:506 [[ 1 -ne 0 ]] +./stack.sh:exit_trap:507 echo ‘Error on exit’ Error on exit +./stack.sh:exit_trap:509 type -p generate-subunit +./stack.sh:exit_trap:510 generate-subunit 1590671485 1360 fail +./stack.sh:exit_trap:512 [[ -z /opt/stack/logs ]] +./stack.sh:exit_trap:515 /usr/bin/python3.8 /home/stack01/devstack/tools/worlddump.py -d /opt/stack/logs World dumping… see /opt/stack/logs/worlddump-2020-05-28-133405.txt for details ebtables v1.8.4 (nf_tables): table `broute’ is incompatible, use ‘nft’ tool. +./stack.sh:exit_trap:524 exit 1 Thanks. Best Regards

                          - Mujtaba Bashir

                          JournalDev
                          DigitalOcean Employee
                          DigitalOcean Employee badge
                          June 3, 2020

                          While installing openstack on Ubuntu 18.04, I am stuck at error: cannot uninstall ‘simplejson’ The problem is with the pip install command. Make the following change to the devstack code: Navigate to the devstack folder. Edit the inc/python file Change line 198: from: $cmd_pip $upgrade $install_test_reqs \ to: $cmd_pip $upgrade $install_test_reqs --ignore-installed \

                          - Rafael

                          JournalDev
                          DigitalOcean Employee
                          DigitalOcean Employee badge
                          December 1, 2020

                          ERROR: Invalid requirement: ‘–ignore-installed’ is what im getting after trying your edit in the python file

                          - DM

                            JournalDev
                            DigitalOcean Employee
                            DigitalOcean Employee badge
                            January 5, 2021

                            Hi There! hope you are doing well. to remove the simplejson error while installing the openstack, you just need to use the below command $sudo apt purge python3-simplejson after that please re run ./stack.sh you will definitely get out from this error for more info please email me “aksmew@gmail.com”

                            - Akshay Mewada

                              Try DigitalOcean for free

                              Click below to sign up and get $200 of credit to try our products over 60 days!

                              Sign up

                              Join the Tech Talk
                              Success! Thank you! Please check your email for further details.

                              Please complete your information!

                              Become a contributor for community

                              Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

                              DigitalOcean Documentation

                              Full documentation for every DigitalOcean product.

                              Resources for startups and SMBs

                              The Wave has everything you need to know about building a business, from raising funding to marketing your product.

                              Get our newsletter

                              Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

                              New accounts only. By submitting your email you agree to our Privacy Policy

                              The developer cloud

                              Scale up as you grow — whether you're running one virtual machine or ten thousand.

                              Get started for free

                              Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

                              *This promotional offer applies to new accounts only.