Running Erlangly

On this page

Upgrades

erlangly upgrade installs the latest release. Before a new version changes the database it takes a snapshot (the last two upgrades' are kept), and if the new version doesn't start, it puts the previous version and the snapshot back by itself. With a lot of data the snapshot and the changes can take a few minutes, and the upgrade waits for them.

They need room, so an upgrade doesn't start without twice the size of the databases free on the disk, and never less than 2 GB: it says how much it needs and how much there is. If you know there's enough, erlangly upgrade --force goes ahead anyway.

Once the new version is up, the upgrade keeps the version before it, for rolling back, and removes older versions, so they don't fill the disk. Restarting, upgrading and rolling back let Erlangly stop cleanly, within 30 seconds: a schedule still being generated then starts again once it's back.

Admins see a note in Erlangly when a new version is out, which says when it fixes a security problem, and What's new lists what's in each release.

erlangly rollback goes back by hand, to the previous version and your data from just before the upgrade. Anything entered since the upgrade is undone, so it says how old that data is and asks before it goes ahead (from a script, erlangly rollback --yes doesn't ask). It saves your data as it is now in /var/backups/erlangly first: to have it back, upgrade to that version again, then erlangly restore the file.

The snapshot is checked before it's put back; if that fails (on a full disk, say), nothing is overwritten, and Erlangly stays stopped until you fix it and run erlangly rollback again.

Going back to a release from before 0.8.165 puts back data from before licenses were activated: after the next upgrade, activate it again.

Upgrades, rollbacks, restores, backups, restarts and changes to what webhooks may reach run one at a time: one started while another is under way stops right away and says which is running, so try it again once that has finished.

With a pay-once license, erlangly upgrade installs releases that came out before your updates end, and your current version keeps running after that. erlangly licence shows the date, and admins hear 30 days before it.

A release that came out later isn't installed, by an upgrade or by installing again over the same data: it says which is the newest public release your updates cover, and how to install it (like erlangly upgrade 0.8.165). It reads the date from Erlangly even while Erlangly is stopped or won't start; if it can't, it stops and says what to do. Without a pay-once key, there's no date to check, so nothing stops an upgrade.

Admins aren't offered a release that came out after their updates ended: the note at the top of the page says it came out after them instead, and that erlangly upgrade names the newest release they still cover. If installing again over the same data stops, it says how to run the version your data is from again.

Backups

  • Every night Erlangly saves a copy of all its data on the server. It keeps one a day for the last 7 days and one a week for the 4 weeks before those, 11 in all, and every one from the last 24 hours (Settings → System shows them, with Back up now). To keep more or fewer, set ERLANGLY_DAILY_BACKUPS and ERLANGLY_WEEKLY_BACKUPS in /etc/erlangly/erlangly.conf and run erlangly restart. Exports aren't in backups: each is a copy of the data already.
  • Those protect against mistakes and bad upgrades, not against losing the server. erlangly backup writes a backup to /var/backups/erlangly: copy it somewhere else with your usual off-site backups.
  • erlangly restore FILE puts a backup back. It's checked first, and a damaged one changes nothing.
  • erlangly restore --copy FILE puts another install's backup on this server as a test copy of it, for a test license.

When something needs looking at

Settings → System starts with anything that needs an admin:

  • an install that isn't activated, or needs activating by a date
  • a nightly backup that failed or stopped
  • background jobs that stopped or failed in the last day (emails included)
  • less free disk than backups and upgrades need
  • a password or secret to enter again after the server was restored
  • an ACD connection Erlangly can't connect to or that has gone quiet while people are on shift
  • Litestream copies that stopped.

Admins see a line about it at the top of every page, and erlangly status on the server prints the same.

Once email is set up, every admin is also emailed about each problem when it first shows: once, not again while it lasts, and again if it comes back after it's been put right for an hour or more. Can't put it right? Getting help says what to send us.

Monitoring

Your floor runs every day, so hear about trouble from your monitoring rather than from agents:

  • Is it up? Point an uptime checker (UptimeRobot, Better Stack or your own) at /up on your Erlangly's address, like https://wfm.example.com/up. It answers 200 once Erlangly is running.
  • Does something need looking at? https://wfm.example.com/up?deep=1 answers 503 while Settings → System lists anything, as above, and 200 otherwise. The one exception is the notice an install from before activation gets: it answers 200 until the notice's last 3 days, so your monitoring hears of it before the install stops. Anyone can ask it, so it says nothing more: Settings → System says what's wrong and how to put it right. Once a minute is plenty (it answers up to 60 times a minute from one address). Leave Docker and load balancers on plain /up: none of these is a reason to restart Erlangly.
  • Disk. Erlangly's data, its nightly backups and its snapshots from before upgrades are in the Docker volume erlangly, on the server's disk (erlangly status says how big). Backups and upgrades need twice the size of the databases free, and never less than 2 GB: Erlangly warns when there's less, and an upgrade doesn't start. Watch the disk with your usual monitoring too: Docker's images and everything else on the server share it.
  • The clock. Keep the server's clock set by NTP, as Ubuntu and Debian do from the start (timedatectl says System clock synchronized: yes). Amazon Connect turns away requests from a clock more than 5 minutes out, and license and trial dates, schedules and adherence all go by it. Erlangly judges a license's dates by the later of the clock and the newest dates in its own data, so setting the clock back changes nothing, and a clock that was once set ahead keeps them ahead: write to us if that happens.

On the server, erlangly status exits with 1 when Erlangly isn't up or something needs looking at (the activation notice, as above, only in its last 3 days), for cron or your monitoring agent. To be emailed only then (if the server can send email), put this in /etc/cron.d/erlangly:

MAILTO=it@example.com
*/15 * * * * root out=$(/usr/local/bin/erlangly status 2>&1) || echo "$out"

Copies off the server, as it changes

With Litestream, Erlangly copies every change to its database to S3-compatible storage (AWS S3, DigitalOcean Spaces, Cloudflare R2, Backblaze B2 and others) within seconds. Add the bucket and its keys to /etc/erlangly/erlangly.conf and run erlangly restart:

LITESTREAM_REPLICA_URL=s3://my-bucket/erlangly?endpoint=tor1.digitaloceanspaces.com
LITESTREAM_ACCESS_KEY_ID=…
LITESTREAM_SECRET_ACCESS_KEY=…

Only Litestream gets the key: Erlangly itself runs without it. Turn on versioning for the bucket too (most providers call it that, or object versioning), so a copy that's deleted or written over can still be brought back.

Once Erlangly is running with them (after installing, erlangly restart or erlangly upgrade), the erlangly command adds a copy of Erlangly's secret key to the same file (ERLANGLY_SECRET_KEY): the passwords and secrets saved in Erlangly are encrypted with it. Keep a copy of the whole file somewhere other than the server, as safe as your backups (an erlangly backup holds the key too): with it, anyone can read the copies in your bucket and the passwords and secrets saved in them.

If you lose the server, put your copy of the file at /etc/erlangly/erlangly.conf on a new one, then install Erlangly there: it restores the data from the copy on its first start, and everything carries on as before.

Without the secret key (a new server given only the three settings, say), the restored Erlangly can't read the passwords and secrets saved in it. Everyone signs in again, links in invitation and password reset emails sent before stop working, and an admin enters each of these again (Settings → System lists the ones it can't read):

  • The mail server's password, under Settings → Email.
  • The client secret for single sign-on, under Settings → Sign-in. Then sign in with it once as a test and require it again, as after any change to how it connects.
  • Each ACD connection's secret, under Settings → Connections: open the connection and choose Change. That's the client secret for Zoom and Genesys Cloud, the access key secret for NICE CXone (and the client secret of your own NICE app registration, if you use one), the password for Five9, the secret access key for Amazon Connect, and the API key secret for Twilio Flex. The connection keeps its agents, state codes and queues, so there's no need to remove it and connect it again.

Email

Under Settings → Email, give Erlangly your mail server, and it sends invitations, password resets, “your schedule is published” and request decisions, and tells admins when something needs looking at. Until then, you copy invitation links and password reset links from the app instead (a person's page under Settings → Users), and if you're the only admin and locked out, erlangly reset-link your@email on the server prints one.

Erlangly sends one email at a time. What someone's waiting for goes first, like a password reset, a request decision or one person's invitation, then “your schedule is published” for a whole floor, then invitations to many people at once.

If the mail server is busy, says to try later or can't be reached for a while, Erlangly tries each email again for about four hours. Settings → Email shows an email it couldn't send, who it was for and why, until the next one goes out, and Settings → System names the last one for a day.

Single sign-on (SSO)

People can sign in with their company account, through Microsoft Entra ID, Google Workspace, Okta or another OIDC provider, set up under Settings → Sign-in. Single sign-on says how to set it up and require it. If you're ever locked out, erlangly sso off on the server stops requiring it.

Exporting your data

Settings → Export makes a .zip with a CSV file for each kind of data: people, sites and teams, lines of business and volume history, forecasts, schedules and shifts, time off, exceptions, adherence and the audit trail. Rows point at each other by ID, and times are in UTC. Text that starts with = + - or @ has a ' put in front, so a spreadsheet keeps it as text instead of running it as a formula.

Passwords, tokens, the license key and the mail and sign-in secrets are left out. Only admins can export, each export and download is in the audit trail, and exports are deleted after a week. On the server, erlangly export writes one to /var/backups/erlangly (or the directory you name).

What leaves your server

Only what you set up (email, your ACD's connection, Litestream copies to your own bucket, sign-in with your identity provider, notifications to the push services of the phones and computers people turn them on for, events to the webhooks an admin adds), and a daily update check that asks get.erlangly.com for the latest version number, which you can turn off under Settings → System. There's no telemetry. Activating the license doesn't go from the server: an admin's browser takes the key's id, a random id for the install and its address to store.erlangly.com, once. Network lists every address, for your firewall.

Removing Erlangly and its data

Everything Erlangly keeps on the server is in one Docker volume, erlangly: the databases, nightly backups, upgrade snapshots, exports, its HTTPS certificate and its secret key. The erlangly command keeps its settings in /etc/erlangly, and what it backs up, exports or saves before a rollback in /var/backups/erlangly, or the folder you gave it. To remove it all for good:

  1. Keep what you need first: erlangly export for your data as CSV files, or erlangly backup to install it again elsewhere, and copy the file off the server. Nothing below can be undone.
  2. Free its license, if you'll use it on another server: under Settings → License, choose Remove the license key (moving a license). Skipped it? Free it later at store.erlangly.com/move. A trial can't move.
  3. On the server, remove Erlangly, its data, its images and its files:
    sudo docker rm -f erlangly
    sudo docker volume rm erlangly
    sudo docker network rm erlangly
    { sudo docker image ls -q erlangly; sudo docker image ls -q ghcr.io/erlangly/erlangly; } | sort -u | xargs -r sudo docker image rm -f
    sudo rm -rf /etc/erlangly /var/backups/erlangly /usr/local/bin/erlangly /etc/cron.d/erlangly
    Remove any other folder you gave erlangly backup or erlangly export too, and, if Erlangly came from your own registry, its images (sudo docker image ls registry.example.com/erlangly). Installed with Docker Compose instead? sudo docker compose down -v in its folder removes its container, its network and its data; then remove the image.
  4. Off the server: delete Erlangly's copies in your Litestream bucket (the path in LITESTREAM_REPLICA_URL) and the key that wrote them, and any backups, exports and copies of erlangly.conf you kept elsewhere: they hold all your data, and the key to the secrets saved in it.
  5. What Erlangly signed in with: revoke the ACD's API key, OAuth client or user made for Erlangly, the app registered with your identity provider for single sign-on, and the mail account's password if it was made for Erlangly.
  6. A yearly license keeps renewing until you cancel it, from the link in your key email (Your license).

Docker stays installed: if nothing else on the server uses it, remove it with your package manager. Deleting files doesn't wipe the disk they were on: to be sure nothing can be recovered, delete the server or its disk as your hosting company or your IT team does.

Other commands

erlangly status        is it up, which version, where to reach it, the disk its data takes, what needs looking at
erlangly logs -f       follow the app's log (the newest 100 MB, with Docker's usual log settings)
erlangly restart
erlangly version
erlangly setup-link    the secret link for a new install's first admin
erlangly reset-link EMAIL   a link for someone to choose a new password (15 minutes, once)
erlangly sso [off]     signing in with your identity provider; off stops requiring it
erlangly two-factor [reset EMAIL]   who signs in with a code from an authenticator app; reset clears someone's