---
title: Backup and restore
description: Take a consistent backup of NexCMP data and configuration with nexcmp backup, and restore it on the same or a new server.
url: https://nexcmp.com/docs/getting-started/backup-and-restore/
applies_to: NexCMP 1.6.1
updated: 2026-11-02
---

# Backup and restore

> **Where in the admin:** System › Admin › Backup (`/backup`) appears only when the DDoS & BGP module is enabled; for a standard installation use the command line below.

## What is backed up

`sudo nexcmp backup` creates one compressed archive containing:

| Part | Content |
|---|---|
| `data/**/*.db` | Every SQLite database in `/var/lib/nexcmp`, copied with SQLite's online backup API — consistent even while the panel is running |
| `files.tar` | All other files in `/var/lib/nexcmp` (settings files, branding uploads, `secrets/`), except databases and the `updates/` folder |
| `etc/` | A copy of `/etc/nexcmp` (installer settings, instance ID, port and bind) |

::: warning The archive contains your master keys
`secrets/` holds the key that encrypts API keys, payment credentials and SMTP passwords stored in the database. The archive is created with permissions `0600`. Store it encrypted and off the server. Without these keys a restored database cannot decrypt its secrets.
:::

## Take a backup

```bash
sudo nexcmp backup                 # writes to /var/backups/nexcmp
sudo nexcmp backup /mnt/nas/nexcmp # or to another directory
```

The command prints the archive path, for example `/var/backups/nexcmp/nexcmp-backup-20261030-120000.tar.zst`.

### Schedule it

```bash
echo '17 3 * * * root /usr/local/bin/nexcmp backup /var/backups/nexcmp && find /var/backups/nexcmp -name "nexcmp-backup-*" -mtime +14 -delete' | sudo tee /etc/cron.d/nexcmp-backup
```

Copy the folder off the machine (object storage, NAS, another server).

## Restore

Restore onto a server where NexCMP of the **same version (or newer)** is installed.

1. Install NexCMP with the [installer](https://nexcmp.com/docs/getting-started/installation/) using the same license and domain, but do **not** run the setup wizard.
2. Stop the services:
   ```bash
   sudo systemctl stop nexcmp-vmd nexcmp
   ```
3. Unpack the archive into a temporary directory:
   ```bash
   sudo mkdir /root/restore && sudo tar --zstd -xf nexcmp-backup-20261030-120000.tar.zst -C /root/restore
   ```
4. Put the files back:
   ```bash
   sudo tar -xf /root/restore/files.tar -C /var/lib/nexcmp
   sudo cp -a /root/restore/data/. /var/lib/nexcmp/
   sudo cp -a /root/restore/etc/. /etc/nexcmp/
   sudo chown -R nexcmp:nexcmp /var/lib/nexcmp
   ```
5. Start the services and check:
   ```bash
   sudo systemctl start nexcmp nexcmp-vmd
   sudo nexcmp status
   ```
6. Sign in to `https://<domain>/admin` with the administrator of the *backed-up* system.

::: tip Rehearse it
Do step 1–6 on a spare server once, before you need it. A backup you have never restored is only a hope.
:::

## Not included

- nginx configuration and certificates (regenerated by the installer; Let's Encrypt certificates are re-issued).
- Your CloudStack / Proxmox VE servers and the virtual machines on them — back those up with their own tools.
