Run in production
Settings and habits that keep an OpenFiles server safe.
On this page
OpenFiles serves files to the public and accepts uploads from your apps, so the server needs some care before others can reach it.
Change the first-start account
Sign in and change the user name and password at once. See Your account.
Use HTTPS
Tokens travel in every upload. Put OpenFiles behind a reverse proxy (for example Nginx or Caddy) that serves HTTPS, and let your apps use the https:// address only.
Listen only on the local address
By default OpenFiles listens on all network interfaces. When a reverse proxy runs on the same server, make OpenFiles listen only on 127.0.0.1. In index.js, change the line
// options.ip = '127.0.0.1';to
options.ip = '127.0.0.1';and restart OpenFiles. With Docker, publish the port only on the local address instead:
docker run -d --name openfiles -p 127.0.0.1:8000:8000 -v openfiles:/www openfilesStart in release mode
npm start runs in debug mode. On a server, start OpenFiles in release mode:
node index.js 8000 --releaseLimit what tokens can do
Give each app its own token with only the storages it needs. See Token permissions.
Restrict the admin interface
The admin interface and the upload API share the same address. If you can, allow the admin pages (/, /api/, /settings/) only from your own network in the reverse proxy, and keep /upload/, /base64/ and /files/ open for your apps and visitors.
Back up
Copy the data folder on a schedule. See Back up your data.