(zettel (meta (back "00001003000000 00001003315000") (backward "00001003000000 00001003315000") (box-number "1") (created "00010101000000") (modified "20211125185833") (published "20211125185833") (role "manual") (syntax "zmk") (tags "#installation #manual #zettelstore") (title "Installation of Zettelstore on a server")) (rights 4) (encoding "") (content "You want to provide a shared Zettelstore that can be used from your various devices.\nInstalling Zettelstore as a Linux service is not that hard.\n\nGrab the appropriate executable and copy it into the appropriate directory:\n```sh\n# sudo mv zettelstore /usr/local/bin/zettelstore\n```\nCreate a group named ''zettelstore'':\n```sh\n# sudo groupadd --system zettelstore\n```\nCreate a system user of that group, named ''zettelstore'', with a home folder:\n```sh\n# sudo useradd --system --gid zettelstore \\\n --create-home --home-dir /var/lib/zettelstore \\\n --shell /usr/sbin/nologin \\\n --comment \"Zettelstore server\" \\\n zettelstore\n```\nCreate a systemd service file and store it into ''/etc/systemd/system/zettelstore.service'':\n```ini\n[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\n```\nDouble-check everything. Now you can enable and start the zettelstore as a service:\n```sh\n# sudo systemctl daemon-reload\n# sudo systemctl enable zettelstore\n# sudo systemctl start zettelstore\n```\nUse the commands ``systemctl``{=sh} and ``journalctl``{=sh} to manage the service, e.g.:\n```sh\n# sudo systemctl status zettelstore # verify that it is running\n# sudo journalctl -u zettelstore # obtain the output of the running zettelstore\n```"))