LibrePortal
Sponsor
Install

Uninstalling

Removing LibrePortal from a machine completely: what to save first, exactly what the uninstaller removes and what it leaves, and how to keep your backups.

On this page
  1. Before you start: keep what you need
  2. Uninstalling
  3. What it removes
  4. What it leaves
  5. Tidying up afterwards
  6. Installing again

This page is about removing LibrePortal itself, and everything with it. To remove one app, see Installing apps instead.

This deletes your apps' data, and the backups on this machine

Uninstalling removes every app and its data, LibrePortal's settings and database, and the backups folder, even if you put that folder on another disk when you installed. If you want to keep anything, copy it somewhere else first, as below.

Before you start: keep what you need#

Decide first whether you might want your apps back, on this machine or another one.

If you might: make sure a recent backup is somewhere the uninstaller won't touch, and that you have its password.

  1. Add a backup location outside LibrePortal's folders, if you don't have one: a USB disk, another machine over SFTP, or cloud storage. See Backups and restore.
  2. Back up everything to it. Press Backup all apps in Admin → Backups, or run sudo -u libreportal libreportal backup all, and wait for it to finish.
  3. Export the repository passwords. Export ▾ → Repository Passwords on the backup centre's Configuration tab. Without the password, the backup can't be opened.

With that done, a new LibrePortal can bring everything back with Restore from backup in its setup wizard.

If you just want a few files out of an app, copy them out now. Your apps' data is in ordinary folders under /libreportal-containers/<app>/, or wherever you put it.

The Local disk location doesn't count

The Local disk backup location is the /libreportal-backups folder, and the uninstaller deletes it. That's true even if you moved it to another disk with --backups-dir when you installed: the uninstaller finds the folder wherever it is. Only a location that points somewhere outside LibrePortal's three folders survives.

Uninstalling#

On the server:

sudo libreportal-uninstall

It finds the install's real folders by itself, so you don't need to tell it where you put them. Before it does anything, it lists what it's about to remove and asks you to type DELETE LIBREPORTAL to confirm. Anything else stops it: "Aborted — nothing was removed."

Why you have to type it out

Typing two words in capitals is hard to do by accident, which is the point. If you really do need to uninstall from a script, --yes skips the question (--unattended does the same). To see what it would remove and its options without removing anything, run sudo libreportal-uninstall --help.

If you're going to reinstall straight away, keep Docker and the apps' downloaded images, which saves a lot of downloading:

sudo libreportal-uninstall --skip-docker-images

What it removes#

In order:

  • LibrePortal's service, and every running app container.
  • Docker, the rootless copy LibrePortal installed for its apps, with its downloaded images, and the dockerinstall user it ran as. (Not with --skip-docker-images.)
  • LibrePortal's swap file, if it made one.
  • The access controls: the firewall rules LibrePortal added for the WebUI and the VPN, the LibrePortal VPN itself, and any limits it put on SSH, which is put back as it was.
  • LibrePortal's programs: the libreportal command, its helpers in /usr/local/lib/libreportal, its sudo rule, and the copies of restic and the other tools it installed.
  • The three folders: /libreportal-system, /libreportal-containers and /libreportal-backups, wherever they were put, and any old copies left from moving one.
  • The libreportal user, and its home folder.

What it leaves#

  • Docker's own packages, the apt packages installed alongside LibrePortal, and your SSH settings.
  • App data on extra disks. If you added a disk and moved apps onto it, their data is left there, and the uninstaller lists each folder at the end so you can decide what to do with it.
  • Backup locations outside LibrePortal's folders: a USB disk, an SFTP server, cloud storage. They're not touched.
  • The firewall. ufw stays switched on, with SSH allowed. The rules LibrePortal added for your apps' ports stay too; they're the ones with the comment LibrePortal.
  • CrowdSec, if you installed it. It runs on the machine itself rather than in a container, so its packages and its apt repository stay.
  • A system setting from wg-easy, if you installed it: the file /etc/sysctl.d/99-libreportal-wireguard.conf, which lets the machine pass VPN traffic on.

Tidying up afterwards#

The firewall is the one leftover worth a look. To see what it's still allowing:

sudo ufw status numbered

The rules marked LibrePortal are for apps that are gone now. Delete them, and any other rule you don't recognise, with sudo ufw delete <number>, starting from the highest number so the others don't shift. Keep the one for SSH, or you'll lock yourself out of a remote server.

If you installed CrowdSec and don't want it any more, remove its two packages, then the apt repository file it added (its name starts with crowdsec_):

sudo apt purge crowdsec crowdsec-firewall-bouncer-nftables
sudo rm /etc/apt/sources.list.d/crowdsec_*.list
sudo apt update

If you installed wg-easy, sudo rm /etc/sysctl.d/99-libreportal-wireguard.conf removes its setting; it stops applying at the next restart.

Installing again#

To start again, run the install command as if on a new machine. You'll get a new WebUI login and a new random WebUI port. To bring your apps back, choose Restore from backup in the setup wizard and point it at the backup you kept.

Next steps