Skip to content

Back up and restore

The server keeps all its data in its data directory. Back up all of the directory.

Do not back up the data directory of a tunnel. See Files. If a machine loses its tunnel data, restore the tunnel access.

  • With no master.key, Paron cannot decrypt the passwords and the private keys in the database, and there is no other method to get them.
  • A person with master.key and paron.db can read the credentials of your machines. See A copy of the database.

For these reasons, the backup below does not include master.key. Copy master.key one time to a different safe place. The file does not change.

broker-ca.key is the identity of the server for the tunnels. If it changes, each tunneled machine refuses the server, and you must set up each tunnel again. Keep it in the backup.

Stop the server before you copy the directory.

Terminal window
sudo systemctl stop paron-server
sudo tar -czf paron-backup.tar.gz --exclude ./master.key -C /var/lib/paron .
sudo systemctl start paron-server

Copy master.key one time:

Terminal window
sudo cp /var/lib/paron/master.key paron-master.key

At each start, the server adds one to the number in broker-serving-index. Each tunnel records the highest number that it accepted, and it refuses a server with a lower number. A backup has the number from the day of the backup, so it is lower than the number that the tunnels recorded.

For this reason, a restore has two procedures:

  • If the current data directory still exists, keep its broker-serving-index.
  • If the current data directory is lost, add 1000000 to the number in the backup. One start adds one, so 1000000 is more than the starts since the backup.

Restore when the data directory still exists

Section titled “Restore when the data directory still exists”

For example, after a failed upgrade or a damaged database.

  1. Stop the server, and move the current directory to a different name.

    Terminal window
    sudo systemctl stop paron-server
    sudo mv /var/lib/paron /var/lib/paron.old
    sudo mkdir /var/lib/paron
  2. Extract the backup, then copy master.key and broker-serving-index from the current directory.

    Terminal window
    sudo tar -xzf paron-backup.tar.gz -C /var/lib/paron
    sudo cp -p /var/lib/paron.old/master.key /var/lib/paron.old/broker-serving-index /var/lib/paron/
  3. Start the server.

    Terminal window
    sudo systemctl start paron-server
  4. When the server works, delete /var/lib/paron.old.

For example, after a disk failure. On a new host, first install Paron and run paron server bootstrap with the same settings as before. Then follow these steps. Put paron-backup.tar.gz and paron-master.key in the current directory.

  1. Stop the server, and empty the data directory.

    Terminal window
    sudo systemctl stop paron-server
    sudo find /var/lib/paron -mindepth 1 -delete
  2. Extract the backup, copy master.key, and add 1000000 to the serving index.

    Terminal window
    sudo tar -xzf paron-backup.tar.gz -C /var/lib/paron
    sudo install -m 600 -o paron paron-master.key /var/lib/paron/master.key
    sudo sh -c 'echo $(( $(cat /var/lib/paron/broker-serving-index) + 1000000 )) > /var/lib/paron/broker-serving-index'
  3. Start the server.

    Terminal window
    sudo systemctl start paron-server

If the server runs as a different account, use that account in install -o.

The server has the data from the day of the backup:

  • Machines and users that you added after the backup are not there.
  • A tunnel that you set up after the backup cannot connect. Set it up again.
  • A tunnel access that you revoked after the backup is valid again. Revoke it again.

© 2026 Nicola Bovolato. Paron is source-available under the PolyForm Shield License 1.0.0.