Files
SaveAny-Bot/docs/content/en/deployment/installation.md
2025-06-16 16:30:45 +08:00

3.1 KiB

title
title
Installation and Updates

Installation and Updates

Deploy from Pre-compiled Files

Download the binary file for your platform from the Release page.

Create a config.toml file in the extracted directory, refer to the Configuration Guide to edit the configuration file.

Run:

chmod +x saveany-bot
./saveany-bot

Process Monitoring

{{< tabs "daemon" >}} {{< tab "systemd (Regular Linux)" >}}

Create a file /etc/systemd/system/saveany-bot.service and write the following content:

{{< codeblock >}} [Unit] Description=SaveAnyBot After=systemd-user-sessions.service

[Service] Type=simple WorkingDirectory=/yourpath/ ExecStart=/yourpath/saveany-bot Restart=on-failure

[Install] WantedBy=multi-user.target {{< /codeblock >}}

Enable startup on boot and start the service:

{{< codeblock >}} systemctl enable --now saveany-bot {{< /codeblock >}}

{{< /tab >}}

{{< tab "procd (OpenWrt)" >}}

Add Boot Autostart Service

Create a file /etc/init.d/saveanybot, refer to wrt_init and modify as needed:

{{< codeblock >}} #!/bin/sh /etc/rc.common

#This is the OpenWRT init.d script for SaveAnyBot

START=99 STOP=10 description="SaveAnyBot"

WORKING_DIR="/mnt/mmc1-1/SaveAnyBot" EXEC_PATH="$WORKING_DIR/saveany-bot" start() { echo "Starting SaveAnyBot..." cd $WORKING_DIR $EXEC_PATH & } stop() { echo "Stopping SaveAnyBot..." killall saveany-bot } reload() { stop start }

{{< /codeblock >}}

Set permissions:

{{< codeblock >}} chmod +x /etc/init.d/saveanybot {{< /codeblock >}}

Then copy the file to /etc/rc.d and rename it to S99saveanybot, also set permissions:

{{< codeblock >}} chmod +x /etc/rc.d/S99saveanybot {{< /codeblock >}}

Add Shortcut Commands

Create a file /usr/bin/sabot, refer to wrt_bin and modify as needed. Note that the file encoding here only supports ANSI 936.

Then set permissions:

{{< codeblock >}} chmod +x /usr/bin/sabot {{< /codeblock >}}

Usage: sudo sabot start|stop|restart|status|enable|disable

{{< /tab >}} {{< /tabs >}}

Deploy Using Docker

Docker Compose

Download the docker-compose.yml file, create a new config.toml file in the same directory, refer to config.example.toml to edit the configuration file.

Start:

docker compose up -d

Docker

docker run -d --name saveany-bot \
    -v /path/to/config.toml:/app/config.toml \
    -v /path/to/downloads:/app/downloads \
    ghcr.io/krau/saveany-bot:latest

Updates

Use upgrade or up to upgrade to the latest version

./saveany-bot upgrade

If you deployed with Docker, use the following commands to update:

docker pull ghcr.io/krau/saveany-bot:latest
docker restart saveany-bot