Files
SaveAny-Bot/docs/content/en/deployment/installation.md
2026-01-05 11:56:19 +08:00

3.8 KiB

title
title
Installation and Updates

Installation and Updates

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

Daemon

{{< 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=always

[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

{{< hint info >}} About Docker image variants

  • Default: Includes all features and dependencies, larger in size. Use this if you don't have special requirements.
  • micro: Slimmed-down image with some optional dependencies removed, smaller in size.
  • pico: Minimal image containing only core features, smallest in size.
You can pull different variants by specifying tags, for example: ghcr.io/krau/saveany-bot:micro
For more details about the variants, see the Dockerfile in the project root. {{< /hint >}}

Updates

If you deployed from pre-compiled binaries, use the following CLI command to update:

./saveany-bot up

(upgrade is also available as an alias.)

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

docker:

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

docker compose:

docker compose pull
docker compose restart