((META (EMPTY-STRING title "Installation of Zettelstore on a server") (WORD role "manual") (TAG-SET tags ("#installation" "#manual" "#zettelstore")) (WORD syntax "zmk") (ZID-SET back ("00001003000000" "00001003315000")) (ZID-SET backward ("00001003000000" "00001003315000")) (NUMBER box-number "1") (STRING copyright "(c) 2020-present by Detlef Stern ") (TIMESTAMP created "20211125191727") (WORD lang "en") (EMPTY-STRING license "EUPL-1.2-or-later") (TIMESTAMP modified "20211125185833") (TIMESTAMP published "20211125185833") (WORD visibility "public")) (BLOCK (PARA (TEXT "You want to provide a shared Zettelstore that can be used from your various devices.") (SOFT) (TEXT "Installing Zettelstore as a Linux service is not that hard.")) (PARA (TEXT "Grab the appropriate executable and copy it into the appropriate directory:")) (VERBATIM-CODE (("" . "sh")) "# sudo mv zettelstore /usr/local/bin/zettelstore") (PARA (TEXT "Create a group named ") (LITERAL-INPUT () "zettelstore") (TEXT ":")) (VERBATIM-CODE (("" . "sh")) "# sudo groupadd --system zettelstore") (PARA (TEXT "Create a system user of that group, named ") (LITERAL-INPUT () "zettelstore") (TEXT ", with a home folder:")) (VERBATIM-CODE (("" . "sh")) "# sudo useradd --system --gid zettelstore \\\n --create-home --home-dir /var/lib/zettelstore \\\n --shell /usr/sbin/nologin \\\n --comment \"Zettelstore server\" \\\n zettelstore") (PARA (TEXT "Create a systemd service file and store it into ") (LITERAL-INPUT () "/etc/systemd/system/zettelstore.service") (TEXT ":")) (VERBATIM-CODE (("" . "ini")) "[Unit]\nDescription=Zettelstore\nAfter=network.target\n\n[Service]\nType=simple\nUser=zettelstore\nGroup=zettelstore\nExecStart=/usr/local/bin/zettelstore run -d /var/lib/zettelstore\nWorkingDirectory=/var/lib/zettelstore\n\n[Install]\nWantedBy=multi-user.target") (PARA (TEXT "Double-check everything. Now you can enable and start the zettelstore as a service:")) (VERBATIM-CODE (("" . "sh")) "# sudo systemctl daemon-reload\n# sudo systemctl enable zettelstore\n# sudo systemctl start zettelstore") (PARA (TEXT "Use the commands ") (LITERAL-CODE (("" . "sh")) "systemctl") (TEXT " and ") (LITERAL-CODE (("" . "sh")) "journalctl") (TEXT " to manage the service, e.g.:")) (VERBATIM-CODE (("" . "sh")) "# sudo systemctl status zettelstore # verify that it is running\n# sudo journalctl -u zettelstore # obtain the output of the running zettelstore")))