# Installation

This guide assumes you’re running FOMO on a Linux server (recommended). If you don’t have the latest build yet, grab it from: [**https://discord.gg/Ky9CY5GhMw**](https://discord.gg/Ky9CY5GhMw)

You can publish your site and find related settings from your docs site's homepage.

#### **SSH into your server**

From your local machine, connect to your Linux server first.\
Once you’re in, continue with the steps below.

```shell
ssh root@<YOUR_SERVER_IP>
```

#### Install essential tools

```shell
apt update
apt install -y curl wget git build-essential pkg-config libssl-dev screen ufw unzip nano
```

#### Increase your open files limit

```shell
ulimit -n 65535
```

#### Create a folder for FOMO

```shell
mkdir -p /root/fomo
cd /root/fomo
```

### Download the release zip

You can download the release zip (**make sure to use latest version!!**). You can find latest release here: [**Github Releases**](https://github.com/FOMO-MEV/FOMO-solana-arbitrage-aggregator-bot/releases). Replace the version numbers below to latest, if necessary.

```shell
wget https://github.com/FOMO-MEV/FOMO-solana-arbitrage-aggregator-bot/archive/refs/tags/v2.0.2.zip -O fomo-v2.0.2.zip
```

#### Unzip it

```shell
unzip fomo-v2.0.2.zip
```

#### Move the files into /root/fomo (the zip creates a versioned folder)

```shell
mv FOMO-solana-arbitrage-aggregator-bot-*/* /root/fomo/
rm -rf FOMO-solana-arbitrage-aggregator-bot-*
```

### Config setup (required)

Rename the example config to the real config

```shell
cp config.example.toml config.toml
```

#### Edit it

**Important:** config.toml must sit in the same directory as the FOMO binary.

```shell
nano config.toml
```

#### Make files executable

```shell
cd /root/fomo
chmod +x *
```

### Encrypt your key (required)

Before FOMO will run, you must generate an encrypted key on the server. This will create your encrypted key file locally. **Keep it safe.**

Run the command below **from the same folder** as the `FOMO` binary. **Note:** format for private key should look like this: `[226,242,156,...]` . No spaces between numbers.\
\
This will generate an encrypted file in the same folder, called: **encrypted\_pk**. Re-running the command, using a different private key will override the existing one.

```shell
./FOMO encrypt-key [your_private_key]
```

### Run FOMO continuously (recommended) <a href="#run-fomo-continuously" id="run-fomo-continuously"></a>

#### Create the systemd service

```shell
nano /etc/systemd/system/fomo.service
```

#### Paste this

```shell
[Unit]
Description=FOMO Arbitrage Aggregator Bot

[Service]
User=root
WorkingDirectory=/root/fomo

ExecStart=/usr/bin/screen -DmS fomo /root/fomo/FOMO
ExecStop=/usr/bin/screen -S fomo -X quit

Restart=always
RestartSec=10

StandardOutput=journal
StandardError=journal

LimitNOFILE=65535

[Install]
WantedBy=multi-user.target
```

#### Enable + start

```shell
systemctl daemon-reload
systemctl enable fomo
systemctl start fomo
```

#### Viewing running bot

```shell
screen -r fomo
```

#### To exit screen without stopping the bot

Ctrl + A, then D

#### If you edit config.toml, restart to apply changes

```shell
systemctl restart fomo
```

#### To stop the bot (and service), run this command

```shell
systemctl stop fomo

## To start it again
systemctl start fomo
```
