# Updating RPort

### Update the RPort clients

It's recommended to run your clients with the recent version of rport. We try to always keep server and client compatible, regardless of the version. Basic connectivity and the usage of tunnels should always be possible with clients running an older version than the server. An exception to that rule is the licence change from 0.9.12 to 1.0.0. **Clients >= 1.0 will not connect to an open-source server <= 0.9.13.**

A fast and easy update of the rport clients can be done through the pairing service. If you have scripting with root privileges enabled, you can trigger a client update through the rport server.&#x20;

{% hint style="success" %}
💡It's safe to execute the update while **being connected** via SSH or RDP **through an RPort tunnel**. On Windows and Linux, the rport client is restarted delayed and from a decoupled background process. You will be disconnected, but the client reconnects, and you can create a new tunnel after the update.
{% endhint %}

#### On Linux

```bash
set -e
if [ $(id -u) -ne 0 ];then 
  echo "Needs to run from the root account. Activate sudo!"
  false
fi
if which at; then
  true
else
  echo "System is missing the at command."
  echo "Try 'dnf -y install at; pidof atd||systemctl start atd' on RHEL"
  echo "Try 'DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install at' on Debian/Ubuntu"
  false
fi
curl -sf https://pairing.openrport.io/update > /tmp/rport-update.sh
at now << EOF
sleep 5
sh /tmp/rport-update.sh >/tmp/rport-update.log 2>&1
rm /tmp/rport-update.sh
EOF
echo "The rport client update will shortly start in the background."
echo "If update fails, inspect /tmp/rport-update.log"
```

<figure><img src="https://1142160776-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MekeI9EovpQqbUTQSdM%2Fuploads%2F3K944qOMrfb4Gca1xpzj%2Fimage.png?alt=media&#x26;token=eee5be9e-adaa-463b-ad91-f95a9b9779c8" alt=""><figcaption><p>RPort client update on Linux</p></figcaption></figure>

The Linux update script accepts parameters as follows:

```
sh rport-update.sh -h

Usage rport-update.sh [OPTION(s)]

Update the current version of RPort to the latest version.

Options:
-h  print this help message
-v [version] update to the specified version.
-c  update the rport client, default action
-t  use the latest unstable version (DANGEROUS!)
-u  uninstall the rport client and all configurations and logs
-x  enable script execution in rport.conf
-d  disable script execution in rport.conf
-s  create sudo rules to grant full root access to the rport user
-n  do not create sudo rules to grant full root access to the rport user
```

#### On Windows

```powershell
cd $env:temp
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$url="https://pairing.openrport.io/update"
Invoke-WebRequest -Uri $url -OutFile "rport-update.ps1"
powershell -ExecutionPolicy Bypass -File .\rport-update.ps1
rm .\rport-update.ps1 -Force
```

![Update the RPort client on Windows with RPort](https://1142160776-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MekeI9EovpQqbUTQSdM%2Fuploads%2F2pr82nYapRRvhk4j0zgH%2Frport-client-update-windows.png?alt=media\&token=a9029e22-ec7d-4ebf-969c-cac5f6c46da7)

The Windows update script accepts parameters as follows:

```powershell
PS C:\Users\Administrator> .\rport-update.ps1 -h
Update the rport client.
Invoking without parameters updates to the latest stable version.

Parameters:
-t  Use the latest unstable version.
-x  Enable command and script execution without asking for confirmation.
-d  Disable command and script execution.
-v [version] Upgrade to the specified version.
```

### Update the RPort server

We keep all major and minor versions of the `rportd` and the frontend compatible. **Do not run different major and minor versions of frontend and backend**.

The rport server has database migrations built-in. But some tables are excluded from auto-migration. An update consists basically of replacing the old `rportd` binary by a newer version. If you need to change the database manually, we will provide SQL snippets.&#x20;

For  a fast, secure and convenient update, use the update script as follows, read the security advice below first:

{% code title="rportd-update.sh" %}

```bash
curl -s https://get.openrport.io/update -o rportd-update.sh
sudo -E bash rportd-update.sh
```

{% endcode %}

👉 After the update, use [SHIFT-Reload](https://en.wikipedia.org/wiki/Wikipedia:Bypass_your_cache) on your browser to **purge the old frontend from the cache**.&#x20;

If you already entered your licence details to the `rportd.conf` file, you must not export them to the environment before starting the update.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kb.openrport.io/digging-deeper/server-maintenance/updating-rport.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
