The post explain how to simply use plakar
to securely backup your files on a remote server:
- remotes files are encrypted: you can backup on your cloud server (OVH, etc..)
- remote files are snapshoted: backups are quick and files are dedupplicated
Ref: https://plakar.io/docs/v1.0.2/quickstart/ Src: https://github.com/PlakarKorp/plakar
Prerequisite
plakar
, of course (brew, apt-get, .. or local compilation)- a
remote host
withssh
access which allowssftp
Let say that:
- your remote host is
backups.company.com
- your remote account is
user
- your remote container is
/home/user/backups
- your local files are located at
$HOME/Documents
Backup process
Creating the remote container
plakar at sftp://user@backups.company.com/home/user/backups create
- you
ssh
password will be requested first (unless you launchedssh-agent
) - a (long and entropic) encryption key will also be requested
Backuping your files
This command will performe the backup:
plakar at sftp://user@backups.company.com/home/user/backups backup $HOME/Documents
Then you run this command for the first time, an error message will appear, asking you to start plakar agent
.
You may decide:
- to run
plakar agent
- to use the backup command with the
-no-agent
flag
Listing all snapshots
plakar at sftp://user@backups.company.com/home/user/backups ls
2025-08-05T07:50:54Z 9e75730e 3.9 GB 6s /Users/user/Documents
2025-08-04T14:16:01Z d2b5a123 3.9 GB 7s /Users/user/Documents
2025-08-04T14:11:49Z ae459cf7 3.9 GB 7s /Users/user/Documents
2025-08-04T13:58:21Z a5958ffa 3.9 GB 6s /Users/user/Documents
2025-08-04T13:49:31Z 5d350cda 3.9 GB 6s /Users/user/Documents
Removing a snapshot
plakar at sftp://user@backups.company.com/home/user/backups rm 5d350cda
Starting a management GUI
A web GUI is also available which allows all maintenance operations
plakar at sftp://user@backups.company.com/home/user/backups ui
this will open your prefered web broser on a local socket:
Automatic backup on macOSX
You can automatize you backups using macOSX features:
- user launch agent
- storing the encryption key in a local file (eg:
~/.ssh/plakar
)
Simply create the ~/Library/LaunchAgents/com.company.plakar.plist
containing:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.company.plakar</string>
<key>LowPriorityIO</key>
<true/>
<key>Nice</key>
<integer>1</integer>
<key>ProgramArguments</key>
<array>
<string>/opt/homebrew/bin/plakar</string>
<string>-no-agent</string>
<string>-keyfile</string>
<string>/Users/user/.ssh/plakar</string>
<string>at</string>
<string>sftp://user@backups.company.com/home/user/backups</string>
<string>backup</string>
<string>/Users/user/Documents</string>
</array>
<key>StartInterval</key>
<integer>7200</integer>
</dict>
</plist>
Load this agent, and verify//start it for the first time:
cd ~/Library/LaunchAgents/
launchctl load com.company.plakar.plist
launchctl list | grep plakar
launchctl start com.company.plakar
Remark: if you want a quicker backup, you need to start the plakar agent
(and remove the -no-agent
argument of this command. I advice you to write a small shell script to to this, and invoke it from the plist file.
#!/bin/bash
#
# my own backup: (using https://plakar.io/docs/v1.0.2/quickstart/)
#
set -euo pipefail
# Configuration variables at the top
PLAKAR="/opt/homebrew/bin/plakar"
KEY="$HOME/.ssh/plakar"
LOCAL="$HOME/Documents"
DEST="sftp://user@backups.company.com/home/user/backups
if ! pgrep -f "$PLAKAR.*agent" >/dev/null; then
"$PLAKAR" -quiet agent &
sleep 1
fi
exec $PLAKAR -keyfile "$KEY" at "$DEST" backup "$LOCAL"