systemd Deployment
systemd is suitable for long-running stable Linux servers. For this type of deployment, the most important thing is to decide the working directory first, then decide where the config file, database, upload directories, and temporary directories should live.
For production launch, do not expose aster_drive directly to the public internet.
systemd only starts the process; HTTPS, domains, HSTS, upload limits, and WebDAV / WOPI passthrough should all be handled by the reverse proxy in front. The browser page baseline Content-Security-Policy is returned by AsterDrive, and the proxy layer should preserve that response header instead of overwriting it with an incompatible policy.
1. Prepare the Runtime Directory
Section titled “1. Prepare the Runtime Directory”sudo useradd -r -s /usr/sbin/nologin asterdrivesudo mkdir -p /var/lib/asterdrivesudo chown -R asterdrive:asterdrive /var/lib/asterdrive2. Place the Executable
Section titled “2. Place the Executable”Put the aster_drive executable at a fixed path, for example:
sudo install -m 0755 ./aster_drive /usr/local/bin/aster_drive3. Prepare the Config File
Section titled “3. Prepare the Config File”Put config.toml into the data/ directory:
sudo mkdir -p /var/lib/asterdrive/datasudo cp config.toml /var/lib/asterdrive/data/config.tomlsudo chown -R asterdrive:asterdrive /var/lib/asterdrive/dataIf you continue using default relative paths, the working directory will usually contain:
data/config.tomldata/asterdrive.dbdata/uploadsdata/.tmpdata/.uploads
For long-term deployment, database paths, local storage paths, and temporary directories should preferably use absolute paths.
If you plan to run long term, do not only think about “how to start”; plan backup and restore at the same time.
SQLite, local storage directories, avatar directories, and any custom local local storage roots should all be included in the same backup strategy. See Backup and Restore.
4. Write the Service File
Section titled “4. Write the Service File”Create /etc/systemd/system/asterdrive.service:
[Unit]Description=AsterDriveAfter=network.target
[Service]Type=simpleUser=asterdriveGroup=asterdriveWorkingDirectory=/var/lib/asterdriveExecStart=/usr/local/bin/aster_driveRestart=on-failureRestartSec=5Environment=RUST_LOG=info
[Install]WantedBy=multi-user.targetIf you are still in an intranet HTTP test environment, you can temporarily set auth.bootstrap_insecure_cookies to true in config.toml.
It only affects the Cookie HTTPS requirement during first initialization. After switching to HTTPS in production, change the corresponding admin setting back to enabled, then remove this static bootstrap option.
5. Start the Service
Section titled “5. Start the Service”sudo systemctl daemon-reloadsudo systemctl enable --now asterdrivesudo systemctl status asterdrive6. View Logs
Section titled “6. View Logs”journalctl -u asterdrive -f7. First Acceptance Check
Section titled “7. First Acceptance Check”/healthreturns 200./health/readyreturns 200.- The home page response headers include the browser page baseline
Content-Security-Policyreturned by AsterDrive. - First startup logs show database updates and default policy initialization have completed.
- The default policy group is visible in the admin panel.
- Browser login works normally.
- If WebDAV is enabled, the actual mount path matches
[webdav].prefix. - If external Office / WOPI openers are enabled, at least one real Office file can be opened and saved.
- If the database, upload directory, or temporary directories are placed on another disk, confirm paths and permissions are correct.
8. Common Environment Variable Patterns
Section titled “8. Common Environment Variable Patterns”Put the Database Somewhere Else
Section titled “Put the Database Somewhere Else”Environment=ASTER__DATABASE__URL=sqlite:///srv/asterdrive/asterdrive.db?mode=rwcListen on All Interfaces
Section titled “Listen on All Interfaces”Environment=ASTER__SERVER__HOST=0.0.0.0Fix the Login Signing Key
Section titled “Fix the Login Signing Key”Environment=ASTER__AUTH__JWT_SECRET=replace-with-your-own-secretRun This Service as a Follower Node
Section titled “Run This Service as a Follower Node”Environment=ASTER__SERVER__START_MODE=followerEnvironment=ASTER__SERVER__FOLLOWER__REMOTE_STORAGE_TARGET_LOCAL_ROOT=/srv/asterdrive/remote-storage-targetsIf you also want the follower node to complete one-time enrollment during startup, temporarily add:
Environment=ASTER_BOOTSTRAP_REMOTE_MASTER_URL=https://drive.example.comEnvironment=ASTER_BOOTSTRAP_REMOTE_ENROLLMENT_TOKEN=enr_replace_meAfter confirming enrollment succeeded, remove these two ASTER_BOOTSTRAP_REMOTE_* values and keep only the long-term ASTER__... overrides required for runtime. See the full flow in Follower Nodes.
9. HTTPS and Domain
Section titled “9. HTTPS and Domain”systemd only starts the service. If you need HTTPS, domains, WebDAV client access, or external Office / WOPI openers, add a reverse proxy in front. The proxy handles TLS, HSTS, upload limits, and long-connection passthrough while preserving the page CSP returned by AsterDrive. See Reverse Proxy Deployment.