# Devstack Installation
**DevStack** is a series of extensible scripts used to quickly bring up a complete OpenStack environment based on the latest versions of everything from git master. The goal of Devstack is to make it easier for developers to dive into OpenStack without having to understand and construct every part of the system at once.
Installing in a dedicated disposable VM is safer than installing on your dev machine! Plus you can pick one of the supported Linux distros for your VM
The source code is available at: [Github repository](https://opendev.org/openstack/devstack)
## Installation
Installing in a dedicated disposable VM is more recommended than installing it on a physical machine.DevStack attempts to support the two latest LTS releases of **Ubuntu**, the latest/current **Fedora** version, **CentOS/RHEL** 8 and **OpenSUSE**.
If preference is not a necessity, **Ubuntu 18.04** is the most tested and stable version to install.
### Detail
#### Ubuntu Installation
Install Ubuntu on your virtual machine. The only thing we need to be aware of is to set the default user to `stack`. The remaining part is trivial.
#### Networking
First, edit `/etc/netplan/00-installer-config.yaml` to set static IP to `10.0.0.2`:
```yaml
# This is the network config written by 'subiquity'
network:
ethernets:
ens3:
addresses:
- 10.0.0.2/24
nameservers:
addresses:
- 8.8.8.8
- 8.8.4.4
routes:
- to: 0.0.0.0/24
via: 10.0.0.1
metric: 100
ens4:
dhcp4: true
gateway4: 192.168.122.1
version: 2
```
Next, reboot the machine.
```bash=
reboot
```
#### Firewall Issue
We must use `update-alternative` to set the symbolic link of iptables, arptables, and ebtables.
[See here](https://stackoverflow.com/questions/63439723/error-in-installation-of-openstack-in-ubuntu)
```bash=
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install iptables
sudo apt-get install arptables
sudo apt-get install ebtables
sudo update-alternatives --set iptables /usr/sbin/iptables-legacy || true
sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy || true
sudo update-alternatives --set arptables /usr/sbin/arptables-legacy || true
sudo update-alternatives --set ebtables /usr/sbin/ebtables-legacy || true
```
#### Install Devstack
First, clone devstack's repository
```
git clone https://opendev.org/openstack/devstack
cd devstack
```
Next, add `local.conf` to the repository with the following setting:
```
[[local|localrc]]
ADMIN_PASSWORD=**SECRET**
DATABASE_PASSWORD=**SECRET**
RABBIT_PASSWORD=**SECRET**
SERVICE_PASSWORD=**SECRET**
FLOATING_RANGE=192.168.33.224/27
FIXED_RANGE=10.0.0.0/24
```
#### Begin Installation
run
```bash
./stack.sh
```
to install openstack.
Eventually, When the installation is complete, you will see a summary of the script's work, including relevant URLs, accounts and passwords, etc.
#### Access Dashboard
Enter
```
http://192.168.1.201/
```
to access horizon dashboard
Since we install openstack in VM, we might need to ssh port forward out so that we can access the dashboard from our browser.
Example ssh configuration file:
```
Host devstack
Hostname 10.0.0.10
Port 22
User stack
LocalForward localhost:8000 localhost:80
```