Files
SaveAny-Bot/en/deployment/installation/index.html
2025-08-24 06:47:31 +00:00

172 lines
14 KiB
HTML

<!doctype html><html lang=en dir=ltr><head><meta charset=UTF-8><meta name=viewport content="width=device-width,initial-scale=1"><meta name=description content="
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
#
systemd (Regular Linux)
Create a file /etc/systemd/system/saveany-bot.service and write the following content:
[Unit]
Description=SaveAnyBot
After=systemd-user-sessions.service
[Service]
Type=simple
WorkingDirectory=/yourpath/
ExecStart=/yourpath/saveany-bot
Restart=always
[Install]
WantedBy=multi-user.target
Enable startup on boot and start the service:
systemctl enable --now saveany-bot
procd (OpenWrt)
Add Boot Autostart Service
Create a file /etc/init.d/saveanybot, refer to wrt_init and modify as needed:
#!/bin/sh /etc/rc.common
#This is the OpenWRT init.d script for SaveAnyBot
START=99
STOP=10
description=&amp;#34;SaveAnyBot&amp;#34;
WORKING_DIR=&amp;#34;/mnt/mmc1-1/SaveAnyBot&amp;#34;
EXEC_PATH=&amp;#34;$WORKING_DIR/saveany-bot&amp;#34;
start() {
echo &amp;#34;Starting SaveAnyBot...&amp;#34;
cd $WORKING_DIR
$EXEC_PATH &amp;amp;
}
stop() {
echo &amp;#34;Stopping SaveAnyBot...&amp;#34;
killall saveany-bot
}
reload() {
stop
start
}
Set permissions:
chmod +x /etc/init.d/saveanybot
Then copy the file to /etc/rc.d and rename it to S99saveanybot, also set permissions:
chmod +x /etc/rc.d/S99saveanybot
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:
chmod +x /usr/bin/sabot
Usage: sudo sabot start|stop|restart|status|enable|disable
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."><meta name=theme-color media="(prefers-color-scheme: light)" content="#ffffff"><meta name=theme-color media="(prefers-color-scheme: dark)" content="#343a40"><meta name=color-scheme content="light dark"><meta property="og:url" content="https://sabot.unv.app/en/deployment/installation/"><meta property="og:site_name" content="Save Any Bot"><meta property="og:title" content="Installation and Updates"><meta property="og:description" content="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 # systemd (Regular Linux) Create a file /etc/systemd/system/saveany-bot.service and write the following content: [Unit] Description=SaveAnyBot After=systemd-user-sessions.service [Service] Type=simple WorkingDirectory=/yourpath/ ExecStart=/yourpath/saveany-bot Restart=always [Install] WantedBy=multi-user.target Enable startup on boot and start the service: systemctl enable --now saveany-bot procd (OpenWrt) Add Boot Autostart Service Create a file /etc/init.d/saveanybot, refer to wrt_init and modify as needed: #!/bin/sh /etc/rc.common #This is the OpenWRT init.d script for SaveAnyBot START=99 STOP=10 description=&amp;#34;SaveAnyBot&amp;#34; WORKING_DIR=&amp;#34;/mnt/mmc1-1/SaveAnyBot&amp;#34; EXEC_PATH=&amp;#34;$WORKING_DIR/saveany-bot&amp;#34; start() { echo &amp;#34;Starting SaveAnyBot...&amp;#34; cd $WORKING_DIR $EXEC_PATH &amp;amp; } stop() { echo &amp;#34;Stopping SaveAnyBot...&amp;#34; killall saveany-bot } reload() { stop start } Set permissions: chmod +x /etc/init.d/saveanybot Then copy the file to /etc/rc.d and rename it to S99saveanybot, also set permissions: chmod +x /etc/rc.d/S99saveanybot 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: chmod +x /usr/bin/sabot Usage: sudo sabot start|stop|restart|status|enable|disable 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."><meta property="og:locale" content="en"><meta property="og:type" content="article"><meta property="article:section" content="deployment"><meta property="article:modified_time" content="2025-08-24T14:47:13+08:00"><title>Installation and Updates | Save Any Bot</title><link rel=icon href=/favicon.png><link rel=manifest href=/manifest.json><link rel=canonical href=https://sabot.unv.app/en/deployment/installation/><link rel=alternate hreflang=zh href=https://sabot.unv.app/deployment/installation/ title=安装与更新><link rel=stylesheet href=/book.min.a22f4c7d8c2bdc5e3d6e34ba11cb59ab50ea5772594e71305bfd5a595dc78b7e.css integrity="sha256-oi9MfYwr3F49bjS6EctZq1DqV3JZTnEwW/1aWV3Hi34=" crossorigin=anonymous></head><body dir=ltr><input type=checkbox class="hidden toggle" id=menu-control>
<input type=checkbox class="hidden toggle" id=toc-control><main class="container flex"><aside class=book-menu><div class=book-menu-content><nav><h2 class=book-brand><a class="flex align-center" href=/en/><img src=/logo.png alt=Logo class=book-icon><span>Save Any Bot</span></a></h2><ul class=book-languages><li><input type=checkbox id=languages class=toggle>
<label for=languages class=flex><a role=button class="flex flex-auto"><img src=/svg/translate.svg class=book-icon alt=Languages>
English</a></label><ul><li><a href=/deployment/installation/>简体中文</a></li></ul></li></ul><ul><li><a href=https://github.com/krau/SaveAny-Bot target=_blank rel=noopener>🔗 GitHub</a></li></ul><ul><li><span>Deployment Guide</span><ul><li><a href=/en/deployment/configuration/>Configuration Guide</a><ul><li><a href=/en/deployment/configuration/storages/>Storage Configuration</a></li></ul></li><li><a href=/en/deployment/installation/ class=active>Installation and Updates</a></li></ul></li><li><a href=/en/usage/>Usage</a><ul></ul></li><li><a href=/en/help/>Frequently Asked Questions</a><ul></ul></li><li><a href=/en/contribute/>Contributing</a><ul></ul></li></ul></nav><script>(function(){var e=document.querySelector("aside .book-menu-content");addEventListener("beforeunload",function(){localStorage.setItem("menu.scrollTop",e.scrollTop)}),e.scrollTop=localStorage.getItem("menu.scrollTop")})()</script></div></aside><div class=book-page><header class=book-header><div class="flex align-center justify-between"><label for=menu-control><img src=/svg/menu.svg class=book-icon alt=Menu></label><h3>Installation and Updates</h3><label for=toc-control><img src=/svg/toc.svg class=book-icon alt="Table of Contents"></label></div><aside class="hidden clearfix"><nav id=TableOfContents><ul><li><a href=#deploy-from-pre-compiled-files>Deploy from Pre-compiled Files</a><ul><li><a href=#process-monitoring>Process Monitoring</a></li></ul></li><li><a href=#deploy-using-docker>Deploy Using Docker</a><ul><li><a href=#docker-compose>Docker Compose</a></li><li><a href=#docker>Docker</a></li></ul></li><li><a href=#updates>Updates</a></li></ul></nav></aside></header><article class="markdown book-article"><h1 id=installation-and-updates>Installation and Updates
<a class=anchor href=#installation-and-updates>#</a></h1><h2 id=deploy-from-pre-compiled-files>Deploy from Pre-compiled Files
<a class=anchor href=#deploy-from-pre-compiled-files>#</a></h2><p>Download the binary file for your platform from the <a href=https://github.com/krau/SaveAny-Bot/releases>Release</a> page.</p><p>Create a <code>config.toml</code> file in the extracted directory, refer to the <a href=../configuration>Configuration Guide</a> to edit the configuration file.</p><p>Run:</p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-bash data-lang=bash><span style=display:flex><span>chmod +x saveany-bot
</span></span><span style=display:flex><span>./saveany-bot
</span></span></code></pre></div><h3 id=process-monitoring>Process Monitoring
<a class=anchor href=#process-monitoring>#</a></h3><div class=book-tabs><input type=radio class=toggle name=tabs-daemon id=tabs-daemon-0 checked>
<label for=tabs-daemon-0>systemd (Regular Linux)</label><div class="book-tabs-content markdown-inner">Create a file <code>/etc/systemd/system/saveany-bot.service</code> and write the following content:<pre><code class=language-text>[Unit]
Description=SaveAnyBot
After=systemd-user-sessions.service
[Service]
Type=simple
WorkingDirectory=/yourpath/
ExecStart=/yourpath/saveany-bot
Restart=always
[Install]
WantedBy=multi-user.target</code></pre>Enable startup on boot and start the service:<pre><code class=language-text>systemctl enable --now saveany-bot</code></pre></div><input type=radio class=toggle name=tabs-daemon id=tabs-daemon-1>
<label for=tabs-daemon-1>procd (OpenWrt)</label><div class="book-tabs-content markdown-inner"><h4>Add Boot Autostart Service</h4>Create a file <code>/etc/init.d/saveanybot</code>, refer to <a href=https://github.com/krau/SaveAny-Bot/blob/main/docs/confs/wrt_init target=_blank>wrt_init</a> and modify as needed:<pre><code class=language-text>#!/bin/sh /etc/rc.common
#This is the OpenWRT init.d script for SaveAnyBot
START=99
STOP=10
description=&amp;#34;SaveAnyBot&amp;#34;
WORKING_DIR=&amp;#34;/mnt/mmc1-1/SaveAnyBot&amp;#34;
EXEC_PATH=&amp;#34;$WORKING_DIR/saveany-bot&amp;#34;
start() {
echo &amp;#34;Starting SaveAnyBot...&amp;#34;
cd $WORKING_DIR
$EXEC_PATH &amp;amp;
}
stop() {
echo &amp;#34;Stopping SaveAnyBot...&amp;#34;
killall saveany-bot
}
reload() {
stop
start
}</code></pre>Set permissions:<pre><code class=language-text>chmod &#43;x /etc/init.d/saveanybot</code></pre>Then copy the file to <code>/etc/rc.d</code> and rename it to <code>S99saveanybot</code>, also set permissions:<pre><code class=language-text>chmod &#43;x /etc/rc.d/S99saveanybot</code></pre><h4>Add Shortcut Commands</h4>Create a file <code>/usr/bin/sabot</code>, refer to <a href=https://github.com/krau/SaveAny-Bot/blob/main/docs/confs/wrt_bin target=_blank>wrt_bin</a> and modify as needed. Note that the file encoding here only supports ANSI 936.
Then set permissions:<pre><code class=language-text>chmod &#43;x /usr/bin/sabot</code></pre>Usage: <code>sudo sabot start|stop|restart|status|enable|disable</code></div></div><h2 id=deploy-using-docker>Deploy Using Docker
<a class=anchor href=#deploy-using-docker>#</a></h2><h3 id=docker-compose>Docker Compose
<a class=anchor href=#docker-compose>#</a></h3><p>Download the <a href=https://github.com/krau/SaveAny-Bot/blob/main/docker-compose.yml>docker-compose.yml</a> file, create a new <code>config.toml</code> file in the same directory, refer to <a href=https://github.com/krau/SaveAny-Bot/blob/main/config.example.toml>config.example.toml</a> to edit the configuration file.</p><p>Start:</p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-bash data-lang=bash><span style=display:flex><span>docker compose up -d
</span></span></code></pre></div><h3 id=docker>Docker
<a class=anchor href=#docker>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell><span style=display:flex><span>docker run -d --name saveany-bot <span style=color:#ae81ff>\
</span></span></span><span style=display:flex><span><span style=color:#ae81ff></span> -v /path/to/config.toml:/app/config.toml <span style=color:#ae81ff>\
</span></span></span><span style=display:flex><span><span style=color:#ae81ff></span> -v /path/to/downloads:/app/downloads <span style=color:#ae81ff>\
</span></span></span><span style=display:flex><span><span style=color:#ae81ff></span> ghcr.io/krau/saveany-bot:latest
</span></span></code></pre></div><h2 id=updates>Updates
<a class=anchor href=#updates>#</a></h2><p>Use <code>upgrade</code> or <code>up</code> to upgrade to the latest version</p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-bash data-lang=bash><span style=display:flex><span>./saveany-bot upgrade
</span></span></code></pre></div><p>If you deployed with Docker, use the following commands to update:</p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-bash data-lang=bash><span style=display:flex><span>docker pull ghcr.io/krau/saveany-bot:latest
</span></span><span style=display:flex><span>docker restart saveany-bot
</span></span></code></pre></div></article><footer class=book-footer><div class="flex flex-wrap justify-between"><div><a class="flex align-center" href=https://github.com/krau/saveany-bot/commit/a4b3b459a978518354d58eea5f91bd509a843c3e title='Last modified by krau | 2025/08/24' target=_blank rel=noopener><img src=/svg/calendar.svg class=book-icon alt>
<span>2025/08/24</span></a></div><div><a class="flex align-center" href=https://github.com/krau/saveany-bot/edit/main/docs/content/en/deployment/installation.md target=_blank rel=noopener><img src=/svg/edit.svg class=book-icon alt>
<span>Edit this page</span></a></div></div><script>(function(){function e(e){const t=window.getSelection(),n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n)}document.querySelectorAll("pre code").forEach(t=>{t.addEventListener("click",function(){if(window.getSelection().toString())return;e(t.parentElement),navigator.clipboard&&navigator.clipboard.writeText(t.parentElement.textContent)})})})()</script></footer><div class=book-comments></div><label for=menu-control class="hidden book-menu-overlay"></label></div><aside class=book-toc><div class=book-toc-content><nav id=TableOfContents><ul><li><a href=#deploy-from-pre-compiled-files>Deploy from Pre-compiled Files</a><ul><li><a href=#process-monitoring>Process Monitoring</a></li></ul></li><li><a href=#deploy-using-docker>Deploy Using Docker</a><ul><li><a href=#docker-compose>Docker Compose</a></li><li><a href=#docker>Docker</a></li></ul></li><li><a href=#updates>Updates</a></li></ul></nav></div></aside></main></body></html>