Skip to main content

Cargo

If you don't want to set up MicroBin as a Docker container, you can also just use it as a simple service. To get started, all you need is to have the executable available on your system. The simplest way to obtain the MicroBin executable is to install it via cargo.

cargo install microbin

Then, to configure MicroBin as a service on your Linux machine, create a file called /etc/systemd/system/microbin.service, paste this into it with the [username] fields all replaced with your username. If you installed MicroBin from Cargo, your executable will be in your user's cargo directory,~/.cargo/bin/microbin.

[Unit]
Description=MicroBin
After=network.target

[Service]
Type=simple
Restart=always
RootDirectory=/

# This is the user that will be used to run the executable
User=[username]
# This is where MicroBin will save your data
WorkingDirectory=/home/[username]/
# This is the location of my executable
ExecStart=/home/[username]/.cargo/bin/microbin

# For full explanation of all of these settings, check https://microbin.eu/docs
# Please at the very least set your admin login details and your public path!

Environment="MICROBIN_ADMIN_USERNAME=admin"
Environment="MICROBIN_ADMIN_PASSWORD=m1cr0b1n"
Environment="MICROBIN_PORT=8080"
Environment="MICROBIN_BIND=0.0.0.0"
# Environment="MICROBIN_PUBLIC_PATH=https://microbin.mylongservername.net"
# Environment="MICROBIN_SHORT_PATH=https://short.net"
Environment="MICROBIN_JSON_DB=false"
Environment="MICROBIN_EDITABLE=true"
Environment="MICROBIN_HIDE_HEADER=false"
Environment="MICROBIN_HIDE_FOOTER=false"
Environment="MICROBIN_HIDE_LOGO=false"
Environment="MICROBIN_NO_LISTING=false"
Environment="MICROBIN_READONLY=false"
Environment="MICROBIN_SHOW_READ_STATS=true"
Environment="MICROBIN_THREADS=1"
Environment="MICROBIN_GC_DAYS=90"
Environment="MICROBIN_WIDE=false"
Environment="MICROBIN_ETERNAL_PASTA=false"
Environment="MICROBIN_PRIVATE=true"
Environment="MICROBIN_HIGHLIGHTSYNTAX=true"
Environment="MICROBIN_QR=true"
Environment="MICROBIN_ENABLE_BURN_AFTER=true"
Environment="MICROBIN_ENABLE_READONLY=true"
Environment="MICROBIN_DEFAULT_EXPIRY=24hour"
Environment="MICROBIN_NO_FILE_UPLOAD=false"
Environment="MICROBIN_HASH_IDS=false"
Environment="MICROBIN_ENCRYPTION_CLIENT_SIDE=true"
Environment="MICROBIN_ENCRYPTION_SERVER_SIDE=true"
Environment="MICROBIN_MAX_FILE_SIZE_ENCRYPTED_MB=256"
Environment="MICROBIN_MAX_FILE_SIZE_UNENCRYPTED_MB=2048"
# Environment="MICROBIN_BASIC_AUTH_USERNAME=something"
# Environment="MICROBIN_BASIC_AUTH_PASSWORD=something"
# Environment="MICROBIN_CUSTOM_CSS="https://myserver.com/custom.css""

[Install]
WantedBy=multi-user.target

Then start the service with systemctl start microbin and enable it on boot with systemctl enable microbin. To update your MicroBin, run cargo install microbin then systemctl restart microbin. An update will never affect your existing pastas, unless there is a breaking change in the data model (in which case MicroBin just won't be able to import your DB), which will always be mentioned explicitly.