Quick start
Get a server running in a few minutes with the setup tool.
Everything is one executable, for Windows, Linux, and macOS.
Get it and run it
On Linux:
wget https://github.com/MultiX0/LocalDrive/releases/latest/download/server
chmod +x server
./serverOn Windows, in PowerShell:
Invoke-WebRequest https://github.com/MultiX0/LocalDrive/releases/latest/download/server.exe -OutFile server.exe
.\server.exeThat URL always points at the newest release. On a Raspberry Pi or an ARM
server, use server-arm64 in place of server. On macOS, build from source:
cd server && go build ./cmd/localdrive.
To take the file by hand instead, it is on
the releases page. A
fresh download is not executable on Linux or macOS, which is what the chmod
line above is for.
Setup offers to install it as localdrive, so that after the first run you can
type localdrive from any directory instead of ./server from one. The rest
of these guides use that name.
With no arguments it runs setup. It asks:
- Where to keep everything. One folder holds the configuration, the database, and the files.
- How to run. Directly on the machine by default, which is lighter. Docker if you want drive management or network discovery. HTTPS works either way.
- Which port. The default is 7443. See Ports and addresses.
- Whether you have a domain. Most people do not, and do not need one.
- An admin username and password, under Docker only. Running directly the server is not up yet for the account to be created against, so the first person to sign up becomes the admin instead. The server refuses to create a second one that way.
- Whether to run it in the background and start it again after a reboot.
Then it generates every secret, writes its own configuration, starts the server, and prints the addresses to open along with a QR code to scan from a phone.
Day to day
localdrive status where it is, and whether it is up
localdrive start start it
localdrive stop stop it
localdrive restart restart it, which is also how a setting change lands
localdrive logs follow the log
localdrive backup copy the database and the library somewhere safe
localdrive reset-admin recover a forgotten admin passwordEvery command takes --dir to point at a specific install, and reads
LOCALDRIVE_HOME when it is set.
No configuration needed
docker compose up -d works on a fresh clone with no .env file at all.
The first time the server starts it generates the secrets it needs, mixing
fresh randomness with an identifier unique to that machine, and writes them to
data/db/secrets.env with owner only permissions. The two helper containers
read the same file, mounted read only, which is how they agree on a shared
secret nobody had to type.
Anything you do set in the environment always wins, so an operator who manages their own secrets is never overridden.
To write a full configuration up front without answering any questions:
localdrive initThat creates .env, Caddyfile, docker-compose.yml, and the secrets, then
stops. Run docker compose up -d or localdrive start afterwards. It works
the same on Windows, macOS, and Linux.
Connect the app
Open the app, and on the connect step it scans your network and lists any server it finds. Tap one. If discovery finds nothing, which is normal on a different subnet or behind a firewall, type the address instead.