# Installing the agent

Installing the agent and getting redirection.io work is rather easy and straightforward. This page will guide you through the redirection.io's agent installation steps.

## Prerequisites and compatible platforms

Using redirection.io requires the ability to run redirection.io's agent on your server. In most of the cases, this means that you need a SSH access with root permissions. If your website uses a shared hosting without SSH access, you won't be able to use redirection.io's features.

Our agent works on Linux and FreeBSD.

## Debian and APT-based distributions

1. Install the `apt-transport-https` package:

```bash
   sudo apt-get install apt-transport-https
   ```

2. Import our apt repository key:

```bash
   sudo mkdir -p /etc/apt/keyrings
   wget -qO- https://packages.redirection.io/gpg.key | sudo tee /etc/apt/keyrings/redirectionio-archive-keyring.asc
   ```

3. Add the debian repository:

```bash
   echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/redirectionio-archive-keyring.asc] https://packages.redirection.io/deb/stable/3 any main" | sudo tee -a /etc/apt/sources.list.d/packages_redirection_io_deb.list > /dev/null
   ```

4. Update the apt cache and install redirection.io's agent:

```bash
   sudo apt update && sudo apt install redirectionio-agent
   ```

5. Once the agent is installed, [edit its configuration file](/content/documentation/agent-documentation/agent-configuration-reference/index.html) (in `/etc/redirectionio/agent.yml` - basically, you only need to change the instance name, which will help you identify the origin of logs collected by redirection.io), and start the service - this depends on the service manager used in your distribution. It can be for instance:

```bash
   sudo systemctl --system daemon-reload
   sudo systemctl restart redirectionio-agent
   ```

You'll have to restart the service every time you change the agent configuration. If something goes wrong, if you need help or have questions, feel free to [contact our support](/content/contact-us/index.html)!

### A note on the systemd service file

If you wish to use environment variables in the agent execution environment when the agent is launched using `systemctl` (for example, in order to use a HTTPS proxy), you can [tweak the content of the systemd service file](/content/documentation/agent-documentation/using-the-agent-behind-a-https-proxy#tweaking-the-redirectionio-agent-service-file/index.html).

## Red Hat and RPM-based distributions

1. Import the signature key:

```bash
   wget -qO- https://packages.redirection.io/gpg.key -O /tmp/redirectionio-gpg.key && sudo rpm --import /tmp/redirectionio-gpg.key && rm /tmp/redirectionio-gpg.key
   ```

2. Add the repository:

```bash
   sudo yum-config-manager --add-repo https://packages.redirection.io/rpm/stable/3/any

# or (Fedora)
   sudo dnf config-manager --add-repo https://packages.redirection.io/rpm/stable/3/any
   ```

3. Install redirection.io's agent:

```bash
   sudo yum install redirectionio-agent

# or (Fedora)
   sudo dnf install redirectionio-agent
   ```

4. Once the agent is installed, [edit its configuration file](/content/documentation/agent-documentation/agent-configuration-reference/index.html) (in `/etc/redirectionio/agent.yml` - basically, you only need to change the instance name, which will help you identify the origin of logs collected by redirection.io), and start the service - this depends on the service manager used in your distribution. It can be for instance:

```bash
   sudo systemctl --system daemon-reload
   sudo systemctl restart redirectionio-agent
   ```

We also provide a [SysV Init script](/content/documentation/agent-documentation/installing-the-agent#system-v-init-script/index.html) for systems which do not use systemd.

## Manual installation

In particular cases, a manual install might be the way to go.

1. Download the last version of redirection.io's agent here: [https://packages.redirection.io/dist/stable/3/any/redirectionio-agent-latest_any_amd64.tar.gz](https://packages.redirection.io/dist/stable/3/any/redirectionio-agent-latest_any_amd64.tar.gz)
2. Extract the archive, move files and edit the configuration according to your needs
3. Run the agent

We also provide an ARM version of the agent, available at [https://packages.redirection.io/dist/stable/3/any/redirectionio-agent-latest_any_aarch64.tar.gz](https://packages.redirection.io/dist/stable/3/any/redirectionio-agent-latest_any_aarch64.tar.gz).

## Windows

At the time of writing, we do not have a Windows binary of the agent, but we may investigate the topic in the future. [Feel free to ask us](/content/contact-us/index.html)!

## Ansible

An [Ansible role is available](https://galaxy.ansible.com/redirectionio/agent/). You may install it using Ansible Galaxy:

```bash
   ansible-galaxy install redirectionio.agent
   ```

## System V init script

Our packages do not provide SysV init scripts. However, should your system require such a script, you can create a `/etc/init.d/redirectionio-agent` file:

```bash
   #!/bin/sh
   #
   # redirectionio-agent start stop daemon for CentOS (sysvinit)
   #
   # chkconfig: - 64 36
   # Default-Start: 2 3 4 5
   # Default-Stop: 0 1 2 3 4 6
   # Required-Start:
   # description: redirectionio-agent start stop daemon for CentOS
   # processname: redirectionio-agent
   # pidfile: none
   # lockfile: /var/lock/subsys/redirectionio-agent

# Source function library.
   . /etc/rc.d/init.d/functions

# Source networking configuration.
   . /etc/sysconfig/network

# Check that networking is up.
   [ "$NETWORKING" = "no" ] && exit 0

USER="redirectionio"
   APPNAME="redirectionio-agent"
   APPBIN="/usr/bin/redirectionio-agent"
   APPARGS=""
   LOGFILE="/var/log/redirectionio.log"
   LOCKFILE="/var/lock/subsys/$APPNAME"

LOGPATH=$(dirname $LOGFILE)

start() {
           [ -x $prog ] || exit 5
           [ -d $LOGPATH ] || mkdir $LOGPATH
           [ -f $LOGFILE ] || touch $LOGFILE

echo -n "$Starting $APPNAME: "
           daemon --user=$USER "$APPBIN $APPARGS >>$LOGFILE &"
           RETVAL=$?
           echo
           [ $RETVAL -eq 0 ] && touch $LOCKFILE
           return $RETVAL
   }

stop() {
           echo -n "$Stopping $APPNAME: "
           killproc $APPBIN
           RETVAL=$?
           echo
           [ $RETVAL -eq 0 ] && rm -f $LOCKFILE
           return $RETVAL
   }

restart() {
           stop
           start
   }

rh_status() {
           status $prog
   }

rh_status_q() {
           rh_status >/dev/null 2>&1
   }

case "$1" in
           start)
                   rh_status_q && exit 0
                   $1
           ;;
           stop)
                   rh_status_q || exit 0
                   $1
           ;;
           restart)
                   $1
           ;;
           status)
                   rh_status
           ;;
           *)
                   echo "$Usage: $0 {start|stop|status|restart}"
                   exit 2
   esac
   ```

This page has been updated on Apr 9, 2026.
