# Upgrading

This guide covers upgrading socktop and socktop-agent to newer versions.

## Upgrading via APT

### Standard Upgrade

The easiest method - upgrade through normal system updates:

```bash
# Update package lists
sudo apt update

# Upgrade socktop packages
sudo apt upgrade socktop socktop-agent

# Or upgrade entire system
sudo apt upgrade
```

The service will automatically restart after the upgrade.

### Verify Upgrade

```bash
# Check new versions
socktop --version
socktop_agent --version

# Check service status
sudo systemctl status socktop-agent

## Upgrading via Cargo

### Update from crates.io

```bash
# Update client
cargo install socktop --force

# Update agent
# on the server running the agent
cargo install socktop_agent --force
sudo systemctl stop socktop-agent
sudo install -o root -g root -m 0755 "$HOME/.cargo/bin/socktop_agent" /usr/local/bin/socktop_agent
# if you changed the unit file:
# sudo install -o root -g root -m 0644 docs/socktop-agent.service /etc/systemd/system/socktop-agent.service
# sudo systemctl daemon-reload
sudo systemctl start socktop-agent
sudo systemctl status socktop-agent --no-pager
# logs:
# journalctl -u socktop-agent -f
```
