Remove a server
Remove servers that you no longer want to manage in Alpacon.
Removal process
There are two ways to remove a server:
alpamon unregister(v2.3.0+) removes the agent from the host and makes a best-effort attempt to delete the workspace record, in one step.- Manual: (1) uninstall the Alpamon agent from the server, then (2) delete the server from the Alpacon workspace.
Both are covered below.
1. Uninstall Alpamon agent
First, remove the agent from your server.
The quickest path is alpamon unregister, which stops and removes the service, deletes the local configuration, and makes a best-effort attempt to delete the workspace server record—all in one step. Run it on the server itself (not over Websh), on alpamon v2.3.0 or later:
# Linux / macOS
sudo alpamon unregister --yes
# Windows (elevated PowerShell, on the server)
& "$env:ProgramFiles\alpamon\alpamon.exe" unregister --yes
To recover a host whose registration is stuck, use alpamon register --force. See Re-registration and recovery.
The per-OS steps below remove the agent and its files manually, and also apply to agents older than v2.3.0.
Debian-based systems (Ubuntu, Debian)
Basic removal:
sudo apt remove alpamon -y && sudo rm -rf /etc/alpamon/alpamon.conf
Complete removal (including all files):
sudo apt remove alpamon --purge -y
Complete removal also deletes:
/etc/alpamon/alpamon.conf/usr/lib/tmpfiles.d/alpamon.conf/lib/systemd/system/alpamon.service/lib/systemd/system/alpamon-restart.service/lib/systemd/system/alpamon-restart.timer/var/log/alpamon/alpamon.log/var/lib/alpamon/alpamon.db
Red Hat-based systems (RHEL, CentOS, Rocky Linux)
Basic removal:
sudo yum remove alpamon
Complete removal (including all files):
sudo yum remove alpamon && \
sudo rm -f /etc/alpamon/alpamon.conf \
&& sudo rm -f /usr/lib/tmpfiles.d/alpamon.conf \
&& sudo rm -f /lib/systemd/system/alpamon.service \
&& sudo rm -f /lib/systemd/system/alpamon-restart.service \
&& sudo rm -f /lib/systemd/system/alpamon-restart.timer \
&& sudo rm -f /var/log/alpamon/alpamon.log \
&& sudo rm -f /var/lib/alpamon/alpamon.db
Windows
From an elevated PowerShell. Stop and delete the service before removing the folder, or the removal fails with a sharing violation:
sc.exe stop alpamon
sc.exe delete alpamon
Remove-Item -Recurse -Force "$env:ProgramFiles\alpamon"
Remove-Item -Recurse -Force "$env:ProgramData\alpamon"
See Windows servers for the full removal and recovery details.
2. Delete from workspace
If you removed the agent with the manual per-OS steps above (not alpamon unregister), the workspace still has the server record—delete it here. alpamon unregister attempts to delete the record automatically, but if it can’t reach the workspace (network or token issue) the server may still appear in the list; delete it here in that case.
Requirements:
- Server status must be Disconnected
- Requires Superuser permission
Deletion steps:
- Go to Servers page
- Select server(s) to delete (checkbox)
- Click Delete (bin) icon at top
- Click Confirm in confirmation modal
- Server is removed from list
Bulk deletion
Delete multiple servers simultaneously.
- Select multiple servers
- Click bin icon
- Confirm
- All selected servers deleted
Important notes
Data loss:
- Server deletion permanently removes:
- Server settings
- Monitoring history
- Command execution history
- Access logs
- Comments
No recovery:
- Deleted server data cannot be recovered
- Backup important data before deletion
Remove agent first:
- If you only delete from Alpacon without removing agent
- Server will continue attempting connections
- May cause unnecessary resource usage
Re-registration
To re-register a removed server:
- Follow Register a server process again
- New installation script will be generated
- Previous data will not be recovered
Troubleshooting
Server not changing to Disconnected:
- Verify agent is completely removed from server:
systemctl status alpamon
- If agent still running, manually stop:
sudo systemctl stop alpamon
sudo systemctl disable alpamon
On Windows, check and stop the service with PowerShell instead:
sc.exe query alpamon
Stop-Service alpamon
Delete button disabled:
- Check server status (cannot delete Connected servers)
- Verify Superuser permissions