> ## Documentation Index
> Fetch the complete documentation index at: https://docs.avert.ldeo.columbia.edu/llms.txt
> Use this file to discover all available pages before exploring further.

# Setting up a RingServer

## Setting up a RingServer

1. **Download the package from the IRIS/EarthScope GitHub:**

   ```bash theme={null}
   git clone https://github.com/iris-edu/ringserver
   ```

   and 'install' it in the `/opt` directory (essentially just move the `ringserver` directory to `/opt` with `sudo mv ringserver /opt/.`). You will likely need `sudo` permissions to do this. Ensure user/group ownership are set recursively to whichever user you want to be responsible for maintaining the ringserver (see later) e.g. `root` or `ringuser`.

2. **Create a configuration.** A simple example looks something like this:

   ```bash theme={null}
   RingDirectory ring
   DataLinkPort 16000
   SeedLinkPort 18000
   ServerID "<name>"
   TransferLogDirectory tlog
   TransferLogRX 0
   MSeedScan /path/to/archive StateFile=/opt/ringserver/scan.state InitCurrentState=y
   ```

   Ultimately, you'll want this process to be run automatically whenever your server restarts. To do this, you can use the `systemd` service manager.

3. **Create a new service file at `/etc/systemd/system/ringserver.service`, containing:**

   ```bash theme={null}
   [Unit]
   Description=Maintain an instance of the IRIS/EarthScope ringserver program.

   [Service]
   User=root
   WorkingDirectory=/opt/ringserver
   ExecStart=/opt/ringserver/ringserver /opt/ringserver/ring.conf

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

4. **Reload the service files to include the new service:**

   ```bash theme={null}
   sudo systemctl daemon-reload
   ```

5. **Start your service:**

   ```bash theme={null}
   sudo systemctl start ringserver.service
   ```

6. **To check the status of your service:**

   ```bash theme={null}
   sudo systemctl status ringserver.service
   ```

7. **To enable your service on every reboot:**

   ```bash theme={null}
   sudo systemctl enable ringserver.service
   ```

8. **If you need to disable your service at any point:**

   ```bash theme={null}
   sudo systemctl disable ringserver.service
   ```

This should have your ringserver up and running. Now you need to configure your firewall to permit access to any external server you want to be able to access your ringserver instance via SeedLink!
