# Deploy Semaphore & Netos Projects

## Introduction

This guide details how to install Ansible Semaphore and automatically import all of the projects referenced in [Netos NetOps](https://docs.netos.io/shelves/netops). For example, to be able to [Install NetBox](https://docs.netos.io/books/semaphore-netbox/page/install-netbox), run through this process first.

### 1. Size Your Server

To run Semaphore and NetBox we'd suggest a server with a minimum of **4 x vCPU and 6GB of RAM, with SSD or NVMe disk**.

<p class="callout info">In the future Netos will publish more comprehensive guidance on server sizing. Many variables need to be taken into account. For example, a static NetBox instance with 100k devices doesn't require many system resources (they are just rows in database tables after all), whereas a NetBox server with 1k devices that is getting hammered by constant API hits, many plugins, and many CPU intensive background jobs is a different story.</p>

### 2. Install Ubuntu 24.04 LTS

The Netos Semaphore solution has been developed and tested only on Ubuntu 24.04 LTS (Long Term Support), which you can [download from here](https://ubuntu.com/download/server). The ISO image will look like: `ubuntu-24.04-live-server-amd64.iso`.

[![image.png](https://docs.netos.io/uploads/images/gallery/2024-09/scaled-1680-/WetQG8UdSFmak0Qm-image.png)](https://docs.netos.io/uploads/images/gallery/2024-09/WetQG8UdSFmak0Qm-image.png)

*[Ubuntu release cycle | Ubuntu](https://ubuntu.com/about/release-cycle)*

<p class="callout warning">Netos Semaphore will not work on earlier versions of Ubuntu.</p>

### 3. Install Semaphore

#### Run Installation Script

On a fresh install of Ubuntu 24.04 LTS with internet access, paste this script.

`sudo wget https://raw.githubusercontent.com/netos-networks/netos-netops/refs/heads/main/easy-deploy.sh && sudo chmod +x easy-deploy.sh && sudo ./easy-deploy.sh`

Alternatively, if you want to clone the repo yourself, follow these exact steps:

```bash
sudo mkdir /netos
cd /netos
sudo git clone https://github.com/netos-networks/netos-netops
cd netos-netops
sudo chmod +x deploy.sh
clear
sudo ./deploy.sh
```

<p class="callout info">The `/netos/` directory is central to many features, and in many cases (such as hard coded Semaphore variables) it's not easy to change, unless we start running `sed` on SQL dumps. Hence, please stick to the directory structure!</p>


#### Installation Process

The `deploy.sh` script will:

1. Install dependencies on Ubuntu using `apt`
2. Install Ansible via `pip` into a `venv`
3. Run the `semaphore-install` Ansible playbook which will: 
    1. Install MySQL and provision the database
    2. Install Semaphore
    3. Import the Netos Semaphore projects from a SQL dump (`semaphore-netos-netops.sql`)
4. Present you with a URL to login to Semaphore to continue with the setup, e.g. **https://10.1.1.1:3000**

<p class="callout info">Re: step 4.3, we decided to import the Semaphore projects using a SQL backup rather than using the [Semaphore UI Restore API](https://semaphoreui.com/api-docs/). The Restore API doesn't support importing secret variables, which would have therefore required a significant amount of work for new users to just get a base instance up and running. You can of course (and should) change all the default passwords in a production build. Over time we'll transition to the Restore API.</p>

<p class="callout info">Netos maintain a master/clean instance of the Semaphore project and create the `semaphore-netos-netops.sql` file as updates are made. If you want to add playbooks or tasks to the project, please create an issue in [Netos NetOps GitHub](https://github.com/netos-networks/netos-netops).</p>

### 4. Installation Screenshots

The following screenshots show the installation process when `deploy.sh` is run on the Ubuntu 24.04LTS server.

[![image.png](https://docs.netos.io/uploads/images/gallery/2024-09/scaled-1680-/EIX5muLV446uBYni-image.png)](https://docs.netos.io/uploads/images/gallery/2024-09/EIX5muLV446uBYni-image.png)

[![image.png](https://docs.netos.io/uploads/images/gallery/2024-09/scaled-1680-/tu8AfGANmC2fIUhD-image.png)](https://docs.netos.io/uploads/images/gallery/2024-09/tu8AfGANmC2fIUhD-image.png)

[![image.png](https://docs.netos.io/uploads/images/gallery/2024-09/scaled-1680-/sb2qTyrvyZkMuZte-image.png)](https://docs.netos.io/uploads/images/gallery/2024-09/sb2qTyrvyZkMuZte-image.png)

<p class="callout info">Note the URL you can connect to and to use TCP port 3000. Note that in the [NGINX configuration guide](https://docs.netos.io/books/semaphore-netops/page/deploying-nginx-certificates), you can present this correctly using a FQDN on TCP443.</p>

### 5. Connect to Semaphore

Once installed you should connect to a page like this, where you can login with the following default credentials. Check the [Users, Accounts, and Tokens](https://docs.netos.io/books/semaphore-netops/page/users-accounts-tokens) guide for more information about credentials and variables.

- Username: `admin`
- Password: `admin`

[![image.png](https://docs.netos.io/uploads/images/gallery/2024-09/scaled-1680-/LryEam4LIUNKu0oh-image.png)](https://docs.netos.io/uploads/images/gallery/2024-09/LryEam4LIUNKu0oh-image.png)

### 6. Delete Unwanted Projects &amp; Tasks

You can delete unwanted projects, views, and tasks from the default Netos installation. When you pull repository updates, as outlined [here](https://docs.netos.io/books/semaphore-netops/page/sync-semaphore-repository-updates-from-netos), it will not change the Semaphore configuration. For example, maybe you want to delete these, if deployed:

[![image.png](https://docs.netos.io/uploads/images/gallery/2024-09/scaled-1680-/f7o7o0krOlML1hQk-image.png)](https://docs.netos.io/uploads/images/gallery/2024-09/f7o7o0krOlML1hQk-image.png)