Skip to content

Plugins

A plugin is a companion service attached to a project, such as a cache or a search engine. The Hub runs it:

  • on the same node as the project,
  • in a private Docker network only the project and its plugins share, so the project reaches it by name and nothing is published on the node,
  • and gives the project environment variables to reach it (for example REDIS_URL), which take precedence over the project’s own variable with the same name.

Every deploy of the project runs its plugins too, so they move with it on moves, failovers and maintenance, and the old node’s copies are removed. A plugin whose settings and image haven’t changed is left running across redeploys. Deleting the project removes its plugins.

Plugin Runs Gives the project
Redis redis:7-alpine, with a generated password, nothing saved to disk unless you turn on snapshots REDIS_URL
SearXNG searxng/searxng, with JSON results enabled SEARXNG_URL

| Supabase REST API | PostgREST, as Supabase serves /rest/v1/ (public) | SUPABASE_REST_URL |

A plugin like Redis starts empty on a new node, so a failover or a move normally loses what it held. Snapshots keep a copy of its data on the Hub so the next node picks up where the last one stopped. They are off by default.

  • How it works: every few minutes (5 by default) the node packs the plugin’s data folder and uploads it to the Hub. The Hub keeps the newest 3 per plugin, each up to 32 MB. When the plugin is deployed on a node, the node first checks whether the Hub’s snapshot is newer than its own and downloads it before starting.
  • Moves lose nothing: a planned move takes one last snapshot on the old node and the new node waits for it (up to 90 seconds).
  • Failover can lose a few minutes: a node that fails can’t take a last snapshot, so the app restarts from the newest one the Hub has.
  • Turning it on restarts the plugin with data saved to disk, so what it held in memory at that moment is lost once.

Manage them under Snapshots in the dashboard, or from the command line (see Snapshots in the command line):

Terminal window
asdl-hub snapshots my-app # what is stored, and when the next is due
asdl-hub snapshot on my-app # switch on, every 5 minutes
asdl-hub snapshot now my-app # take one now
asdl-hub snapshot restore my-app 4 # put generation 4 back (asks first)
asdl-hub snapshot off my-app # switch off; add --delete to drop stored copies

Snapshots need the Hub to be reachable from its nodes over the private network: they are switched on automatically when WG_HUB_IP is set, or by setting SNAPSHOT_URL on the Hub server. SNAPSHOT_KEEP and SNAPSHOT_MAX_MB change how many copies are kept and the size limit.

Snapshots are for caches and queues you would rather not lose, not a backup of data you can’t recreate. Keep that in a database.

Most plugins are private: only their project reaches them. A public plugin ("public": true) is also served by the Hub at a domain and path you choose when you attach it, like a project. The node publishes its port, and the Hub routes the domain to wherever the project runs; the route follows it when it moves. See Self-hosted Supabase for a full example.

In Plugins, pick a project under the plugin and click Add (plugins that need settings, or a domain for public ones, ask for them). The project is redeployed with it. Project cards list their plugins; the × removes one (and redeploys the project without it).

Or with the API: POST /api/v1/projects/:id/plugins with {"plugin_id": "redis"} (plus "vars", and "domain"/"route_path" for public plugins); PUT /api/v1/projects/:id/plugins/:plugin to change its settings or route; DELETE /api/v1/projects/:id/plugins/:plugin to remove it.

Admins can add their own under Plugins → Custom plugin, as JSON:

{
"id": "memcached",
"name": "Memcached",
"description": "A small in-memory cache next to the app.",
"image": "memcached:1.6-alpine",
"port": 11211,
"command": ["memcached", "-m", "64"],
"vars": [{ "key": "password", "label": "Password", "secret": true, "generate": 32 }],
"env": {},
"files": [{ "path": "/etc/app/config.yml", "content": "port: {{port}}" }],
"provides": { "MEMCACHED_URL": "{{host}}:{{port}}" }
}
  • provides is the variables the project gets (required unless public).
  • "public": true makes it servable at a domain and path chosen on attach.
  • In command, env, files and provides you can use {{host}} (the plugin’s name in the project’s network, which is its id), {{port}}, and {{var.KEY}} for settings declared in vars.
  • A var with generate gets a random value of that length if none is given; secret values are stored encrypted and never shown again.
  • files are written on the node and mounted read-only at path.

The Hub only stores the description; the image is downloaded only on the nodes that run it.