- Hetzner Account
- Github Account
- Run command "ssh-keygen -t ed25519" in terminal
- Select ``Console` and create a new Project
- Select
Securityand add a SSH-Key. Copy the whole content of the id_ed25519.pub file into the input field
- Select
Serverand add a Server. - Choose a Server-type and location.
- For a Image klick on
Appsand select Docker CE. - Add yor SSH-Key and scroll down
Name.
- Klick on the new Server and select Tab
Firewalls. ThenCreate Firewall. - The presets can stay. Just add one new incoming-rule with port
3000. Then clickCreate Firewallagain.
- Open the Terminal and type
ssh root@<Server-IP>
Run curl -sSL https://dokploy.com/install.sh | sh in the Terminal
If you want more and cheap storage you can use Hetzner Storage Box and connect it via rclone for encrypted access.
- Run
ssh root@your-server-ip-address
- Connect to your VPS Server via SSH
- Run
apt install rclone
-
Run
ssh-keygen -t ed25519 -f ~/.ssh/storagebox -C "DokployStorageBox" -
Hit Enter twice to set no passphrase
-
Run
ssh-keyscan uXXXXX.your-storagebox.de >> ~/.ssh/known_hosts -
Execute
cat ~/.ssh/storagebox.pubthen to get the public key. -
Copy that key and add it to your Hetzner project ssh keys
Step 5 - Rclone Config
- Run this command with your password
rclone obscure YOURSUPERSECUREPASSWORDand copy the result. - Run
nano ~/.config/rclone/rclone.confand paste the following code with your values for host, user and pass.
[storagebox]
type = sftp
host = uXXXXX.your-storagebox.de
user = uXXXXX
port = 23
pass = <obscured-password>- Run
rclone ls storagebox:to test the connection You should get a result like247 .ssh/authorized_keys.
- Run
rclone mkdir storagebox:datato create a data-folder - Run
rclone lsd storagebox:to check
- Generate 2 new passwords and create the hash with
rclone obscure - Run
nano ~/.config/rclone/rclone.confagain and append the following code with your password & password2
[storagebox-crypt]
type = crypt
remote = storagebox:data
filename_encryption = standard
directory_name_encryption = true
password = YOUR_ENCRYPTION_PASSWORD
password2 = YOUR_SALT_PASSWORD- Run
mkdir -p /mnt/storagebox-cryptto crate a mount directory - Run
nano /etc/systemd/system/rclone-storagebox-crypt.service
[Unit]
Description=Mount rclone encrypted Storage Box
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=root
ExecStart=/usr/bin/rclone mount storagebox-crypt: /mnt/storagebox-crypt \
--allow-other \
--buffer-size 256M \
--dir-cache-time 12h \
--vfs-cache-mode writes \
--vfs-cache-max-size 512M \
--vfs-read-chunk-size 64M \
--vfs-read-chunk-size-limit 256M \
--poll-interval 1m \
--timeout 1m \
--log-level INFO \
--allow-non-empty
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target
With this the local mount directory will be connected with the storagebox. Every Folder for the Applications will be created automatically based on your docker-compose configuration.
This would cause an error somehow because the connection will be lost after time. to fix that there is a symbolic-link needed.
Run ln -s /mnt/storagebox-crypt /media/storagebox-crypt to create a link that uses the media directory.
Your services should use /media/storagebox-crypt instead of /mnt/storagebox-crypt in the volume settings.
- Then Run
systemctl start rclone-storagebox-crypt.service - And don't forget to enable it to start it automaticaly
systemctl enable rclone-storagebox-crypt.service
ls /var/lib/docker/volumes
rclone ls storagebox-crypt:
- sudo apt install wireguard
- sudo nano /etc/wireguard/wg0.conf
Copy the config into the file and modify it
[Interface]
PrivateKey =
Address = 10.8.0.2/24
[Peer]
PublicKey =
PresharedKey =
AllowedIPs = 192.168.1.0/24
PersistentKeepalive = 25
Endpoint =
- sudo wg-quick up wg0
- sudo wg
- ping 192.168.1.10
Backup-Job (with Wireguard & Rclone)
- Run
nano ~/.config/rclone/rclone.confagain and append the following modified configuration.
[nas]
type = smb
host = 192.168.x.x
user = your_nas_username
pass = your_nas_password
after that run rclone sync storagebox-crypt: nas:/YourShareName --progress --checksum to sync the data manually.
To run the sync automatically create a sh-file with nano /usr/local/bin/backup_storagebox.sh
# Start WireGuard VPN
sudo wg-quick up wg0
sleep 5
rclone sync storagebox-crypt: nas:/YourShareName --progress --checksum
sudo wg-quick down wg0
Then make the script executable with sudo chmod +x /usr/local/bin/backup_storagebox.sh
Edit cronjob file with crontab -e
and add 0 2 * * * /usr/local/bin/backup_storagebox.sh >> /var/log/backup_storagebox.log 2>&1 for example. This runs every day at 2:00 AM then.
To be able to upload large files (>100MB) without interruptions you need to modify the traefik.yml in the Traefik File System (Home).
For that you need to add the following to entryPoints.
transport:
respondingTimeouts:
readTimeout: 0
writeTimeout: 0
idleTimeout: 180sresult:
entryPoints:
web:
address: :80
websecure:
address: :443
http3:
advertisedPort: 443
transport:
respondingTimeouts:
readTimeout: 0
writeTimeout: 0
idleTimeout: 180s
http:
tls:
certResolver: letsencrypt