title: Installation of Zettelstore on a server
role: manual
tags: #installation #manual #zettelstore
syntax: zmk
back: 00001003000000 00001003300000 00001003315000
backward: 00001003000000 00001003300000 00001003315000
box-number: 1
copyright: (c) 2020-present by Detlef Stern <ds@zettelstore.de>
created: 20211125191727
forward: 00001010090100
lang: en
license: EUPL-1.2-or-later
modified: 20250227220033
published: 20250227220033
visibility: public

You want to provide a shared Zettelstore that can be used from your various devices.
Installing Zettelstore as a Linux service is not that hard.

Grab the appropriate executable and copy it into the appropriate directory:

    # sudo mv zettelstore /usr/local/bin/zettelstore

Create a group named `zettelstore`:

    # sudo groupadd --system zettelstore

Create a system user of that group, named `zettelstore`, with a home folder:

    # sudo useradd --system --gid zettelstore \
        --create-home --home-dir /var/lib/zettelstore \
        --shell /usr/sbin/nologin \
        --comment "Zettelstore server" \
        zettelstore

Create a systemd service file and store it into `/etc/systemd/system/zettelstore.service`:

    [Unit]
    Description=Zettelstore
    After=network.target
    [Service]
    Type=simple
    User=zettelstore
    Group=zettelstore
    ExecStart=/usr/local/bin/zettelstore run -d /var/lib/zettelstore
    WorkingDirectory=/var/lib/zettelstore
    [Install]
    WantedBy=multi-user.target

Double-check everything. Now you can enable and start the zettelstore as a service:

    # sudo systemctl daemon-reload
    # sudo systemctl enable zettelstore
    # sudo systemctl start zettelstore

Use the commands `systemctl` and `journalctl` to manage the service, e.g.:

    # sudo systemctl status zettelstore  # verify that it is running
    # sudo journalctl -u zettelstore     # obtain the output of the running zettelstore

A word of caution: Never expose Zettelstore directly to the Internet.
As a personal service, Zettelstore is not designed to handle all aspects of the open web.
For instance, it lacks support for certificate handling, which is necessary for encrypted HTTP connections.
To ensure security,  place Zettelstore behind a proxy server designed for Internet exposure.
For more details, see: [External server to encrypt message transport](00001010090100).