Quick Start
Get up and running in under a minute.
Ephemeral Mode (Try It Out)
Ephemeral mode uses transient storage. Uploaded files stay in memory and are lost when the server stops, and the SQLite database is a scratch file, <random>.db, in a private directory of the system temp directory ($TMPDIR, or /tmp when it is unset) named mahresources-ephemeral-<uid>, beside a <random>.lock file the server keeps locked while it runs. The server deletes the database, its -wal and -shm files and the lock file on a graceful shutdown (SIGINT or SIGTERM). A server that was killed cannot, but its lock goes with it, so on Linux and macOS every ephemeral start deletes, in that directory, the files of any database whose lock file no process holds. A file there without a lock file is left alone. Older releases put the database at /tmp/mahresources_ephemeral_<pid>.db and never deleted it; nothing removes those automatically, since a name alone does not prove where a file came from. Once no older server is running, delete them by hand.
./mahresources -ephemeral -bind-address=:8181
-bind-address (or BIND_ADDRESS) has no default: without it the server listens on port 80, which normally fails for a non-root user.
Open http://localhost:8181 in your browser.
Your First Upload
- Navigate to Resources in the top navigation bar
- Click the Create button
- Select a file to upload
- Add a name and optional description
- Click Save
The file is stored and indexed. Images get automatic thumbnails.
Your First Note
- Navigate to Notes in the top navigation bar
- Click the Create button
- Enter a title and text
- Optionally select a Note Type (you can create one under Note Types in the Admin menu)
- Click Save
Persistent Setup
To keep data between restarts, configure a database and file path.
SQLite (Recommended for Getting Started)
./mahresources \
-db-type=SQLITE \
-db-dsn=./mahresources.db \
-file-save-path=./files \
-bind-address=:8181
This creates:
mahresources.db- SQLite database for all metadatafiles/- Directory where uploaded files are stored
PostgreSQL (For Larger Deployments)
./mahresources \
-db-type=POSTGRES \
-db-dsn="host=localhost user=mah password=secret dbname=mahresources" \
-file-save-path=/var/lib/mahresources/files \
-bind-address=:8181
Environment Variables
All flags can also be set as environment variables in a .env file:
# .env file
DB_TYPE=SQLITE
DB_DSN=./mahresources.db
FILE_SAVE_PATH=./files
BIND_ADDRESS=:8181
Then run:
./mahresources
Next Steps
Next: First Steps to learn how to organize content.