Common tasks
This page covers common configuration tasks for managing Canasta instances, including configuring logos, permissions, and deployment options.
Configuration commands
Canasta has four commands for managing instance configuration:
canasta config get [KEY]β show the value of a configuration key, or all settings ifKEYis omitted. In the full listing, credential values are masked (see Which keys are treated as secret); name the key, or pass--show-secrets, to see them.canasta config set KEY=VALUEβ change a configuration value. The set of recognized keys is enforced; use--forceto set keys outside the known list. Every argument must have the formKEY=VALUE: anything else β for exampleMW_SITE_FQDN wiki.example.comβ is rejected before anything is changed. To set a value containing spaces, quote the whole setting, as in'KEY=two words'. A value containing a line break is rejected.canasta config unset KEYβ remove a setting (reverts to default).canasta config refresh-template [FILE]β adopt the current CLI's version of a template-seeded config file (e.g.config/default.vcl,config/settings/global/Vector.php), or restore one you deleted. These files are seeded once at create time and then owned by you, so upgrades never change them. Read-only unless--applyis given: with no argument it lists seed files that differ from the current template; with a file it shows the diff and changes nothing until you add--apply.
The first three are stored in the instance's .env file (Compose) or the corresponding Kubernetes Secret/ConfigMap, and keep those, the in-instance derived files, and the rendered Caddyfile consistent. See CLI:canasta config for the full reference. After editing a configuration file by hand, run canasta reconcile to apply it; see CLI:canasta reconcile.
Applying configuration changes
Most canasta config commands restart the instance to apply the
change. On a gitops-managed Kubernetes instance, canasta config set
and canasta config unset stage the change for Argo CD instead; deploy it with
canasta gitops push and canasta gitops sync (see
Applying changes on Kubernetes). To apply configuration you edited by hand under config/
(for example a file in config/settings/, config/wikis.yaml,
or .env) without a full stop/start, run canasta reconcile:
it re-renders and re-syncs the configuration and converges the running instance
in place. On Kubernetes this re-syncs the ConfigMaps and rolls only the web pods
whose configuration changed, rather than recreating the whole stack. (Newly
added extensions or skins are symlinked at pod startup, so adding one still
needs a canasta restart on Kubernetes.)
Inspecting an instance
To check whether an instance is running and see its containers, volumes, ingress, and (on Kubernetes) TLS certificate state in one place:
canasta status --id mywiki
Works for both Docker Compose and Kubernetes β no need to remember docker compose ps vs. kubectl get pods,pvc,ingress,certificate -n canasta-mywiki. Add --host <name> when canasta runs on a different machine than the instance.
For Kubernetes instances under gitops management, list Argo CD Applications and their sync/health state:
canasta argocd apps --host node1
Storage classes available on the cluster (and the canasta-configured default for new instances):
canasta storage list --host node1
The full set of inspection-style commands lives under CLI:canasta β see also CLI:canasta list for the registry-wide table, CLI:canasta argocd for the Argo CD command group, and CLI:canasta gitops status for git-side state.
Default settings
Aggressive bots routinely target new wikis as soon as they appear on the internet. It is a better security posture to start with a closed wiki, ensure all appropriate access controls and content are in place, and then make a deliberate choice about when and how to open it up.
New Canasta instances include a config/settings/global/DefaultSettings.php file that makes all wikis private by default. The file contains:
<?php
$wgGroupPermissions['*']['read'] = false;
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['*']['createaccount'] = false;
This prevents anonymous users from reading, editing, or creating accounts on any wiki in the instance.
Making a wiki public
The three permissions control different levels of access for anonymous (logged-out) users:
readβ view pages. Set totrueto make the wiki publicly readable.editβ edit pages. Most public wikis leave thisfalseso that only registered users can make changes.createaccountβ register new accounts. Set totrueif you want anyone to be able to sign up. Leavefalseif administrators should control who gets an account.
To make all wikis publicly readable, edit config/settings/global/DefaultSettings.php and change the permissions you want to allow. For example, a common configuration for a public wiki that requires login to edit:
<?php
$wgGroupPermissions['*']['read'] = true;
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['*']['createaccount'] = true;
To delete the file entirely is equivalent to setting all three to true (MediaWiki's built-in defaults).
To make a specific wiki public while keeping others private, create a per-wiki settings file:
<?php
// config/settings/wikis/{wiki-id}/Permissions.php
$wgGroupPermissions['*']['read'] = true;
$wgGroupPermissions['*']['createaccount'] = true;
Per-wiki settings are loaded after global settings, so they override the defaults for that wiki only. Permissions not listed in the per-wiki file keep the global value (in this example, edit remains false).
See the MediaWiki documentation for the full list of available permissions.
Configuring logos and favicons
MediaWiki uses the $wgLogos configuration variable to set the wiki logo. See the MediaWiki documentation for details on logo sizes and formats.
There are two approaches to configuring logos in Canasta, depending on whether you want the logo to follow wiki permissions or be publicly accessible.
Option 1: Public assets directory (recommended for most cases)
Place your logo and favicon in the public_assets/ directory. This directory is organized by wiki ID, so each wiki has its own subdirectory:
cp /path/to/logo.png public_assets/{wiki-id}/logo.png
cp /path/to/favicon.ico public_assets/{wiki-id}/favicon.ico
The URL path used to reference these files depends on each wiki's url in wikis.yaml:
- If the wiki's
urlhas no path component (e.g.wiki.example.com), reference assets at/public_assets/.... - If the wiki's
urlhas a path component (e.g.wiki.example.com/docs), include that path:/docs/public_assets/.... - With very short URLs enabled (
CANASTA_ENABLE_VERY_SHORT_URLS=true): the very-short-URL article rewrite intercepts root-level/public_assets/...requests, so reference assets through the script path with the explicit wiki ID instead β/w/public_assets/{wiki-id}/logo.png(and likewise for the favicon).
For each wiki, configure logo and favicon in a per-wiki settings file. Example for a wiki with no URL path:
<?php
# config/settings/wikis/{wiki-id}/Logo.php
$wgLogos = [
'1x' => "/public_assets/logo.png",
];
$wgFavicon = "/public_assets/favicon.ico";
For a wiki whose url is wiki.example.com/docs:
$wgLogos = [
'1x' => "/docs/public_assets/logo.png",
];
$wgFavicon = "/docs/public_assets/favicon.ico";
Apache routes /[<path>/]public_assets/... requests to the correct wiki's filesystem subdirectory based on the request's hostname and (when present) URL path.
This approach:
- Always publicly accessible β works for both public and private wikis
- Works for wiki farms β each wiki has its own subdirectory
- Fast β served as static files without MediaWiki overhead
- Persists across upgrades β stored in a mounted volume
Use this option for private wikis that need a visible logo on the login page, or any wiki where you want fast, public access to the logo.
Option 2: Upload via MediaWiki
Upload your logo through MediaWiki's Special:Upload page, then reference it in a settings file:
<?php
# config/settings/wikis/{wiki-id}/Logo.php
$wgLogos = [
'1x' => $wgUploadPath . '/Logo.png',
];
This approach:
- Follows wiki permissions β on public wikis, anyone can see the logo; on private wikis, only logged-in users can see it
- Works for wiki farms β each wiki uploads its own logo
- Persists across upgrades β uploaded files are stored in the
images/directory
Use this option for fully private wikis where the logo should not be visible to logged-out users.
Summary
| Scenario | Solution |
|---|---|
| Public wiki | Either option works |
| Private wiki, logo visible on login page | Public assets directory |
| Private wiki, logo hidden from logged-out users | Upload via MediaWiki |
Deploying behind a reverse proxy
When running Canasta behind an external reverse proxy that terminates SSL and forwards requests to Canasta over HTTP (such as nginx, a cloud load balancer, or Cloudflare in "Flexible SSL" mode), you must tell Caddy to serve over HTTP only. Otherwise, Caddy will attempt to provision certificates and listen on HTTPS, causing redirect loops or connection errors.
On Docker Compose, the HAProxy edge then serves the instance over plain HTTP on its HTTP_PORT, with no certificate and no redirect. Name the proxy in TRUSTED_PROXIES as well, so the edge takes the client address from it, keeps its X-Forwarded-Proto header, and applies per-client rate limits.
For a new instance, create an env file with the setting and pass it to canasta create:
TLS_MODE=off
canasta create -i myinstance -w main -n example.com -e custom.env
The instance is then served over plain HTTP on its HTTP_PORT (80 by default).
For an existing instance:
canasta config set TLS_MODE=off
To re-enable automatic HTTPS (e.g., if you move the wiki off the reverse proxy):
canasta config unset TLS_MODE
Changing the domain name
The domain name for each wiki is stored in config/wikis.yaml in its url field. Each wiki has a domain name (possibly a subdomain) and an optional path component. Examples:
https://example.com(top level domain)https://docs.example.com(subdomain)https://example.com/docs(top level domain and path)https://docs.example.com/guide(subdomain and path)
The .env file contains two domain-related variables:
MW_SITE_SERVERβ the full URL of the primary wiki (e.g.,https://example.com)MW_SITE_FQDNβ the domain name of the primary wiki (e.g.,example.com)
These refer specifically to the primary (first) wiki in the instance as listed in the config/wikis.yaml file. In a wiki farm, additional wikis may use the same domain (path-based) or different domains (a completely different domain or subdomain with an optional path), and their URLs are managed entirely in wikis.yaml.
GitOps-managed instances: if your instance is managed with gitops, config/wikis.yaml and .env are rendered files and editing them by hand is not durable. See GitOps instances below.
Single wiki or path-based farm
To change the domain of the primary wiki and any other wikis using that domain, change it with a single command:
canasta config set MW_SITE_FQDN=newdomain.example.com
MW_SITE_FQDN is the bare domain (no scheme). The scheme (http:// or https://) is preserved from the existing MW_SITE_SERVER. To switch schemes at the same time, run a follow-up canasta config set MW_SITE_SERVER=https://newdomain.example.com afterward.
This cascades automatically:
- Updates
MW_SITE_FQDNin.envand rewritesMW_SITE_SERVERwith the new domain (preserving the scheme) - Rewrites the
urlfield inconfig/wikis.yamlonly for wikis whose current host matches the oldMW_SITE_FQDNβ wikis on different domains (e.g. subdomain-based farm members) are not touched - Regenerates the Caddyfile from the updated
wikis.yamland restarts the instance
If you also need to change a path-based wiki's path component (e.g. /docs β /knowledge), edit config/wikis.yaml directly β the cascade above only rewrites the domain portion β then apply it:
canasta reconcile
Domain-based farm
When wikis use different domains or subdomains, you only need to change MW_SITE_FQDN (as above) if the primary wiki's domain is changing.
To change a non-primary wiki's domain, edit its url in config/wikis.yaml, then apply it:
canasta reconcile
Note: canasta reconcile regenerates the Caddyfile from wikis.yaml, reloads Caddy and clears the Varnish cache, without restarting the instance.
GitOps instances
On a gitops-managed instance, config/wikis.yaml and .env are rendered files. Their sources are hosts/<host>/vars.yaml together with the *.template files, and canasta gitops pull re-renders the rendered files from them.
You can make the change on either side, then run canasta reconcile, which brings the two into agreement whichever one you edited, and push:
- Rendered files: edit the wiki's
urlinconfig/wikis.yaml; for the primary wiki, also changeMW_SITE_FQDNandMW_SITE_SERVERin.env.reconcilewrites the changes intohosts/<host>/vars.yaml. - Sources: in
hosts/<host>/vars.yaml, set the wiki'swiki_url_<id>; for the primary wiki, also setmw_site_fqdnandmw_site_server.reconcilerenders the changes into the rendered files.
canasta reconcile
canasta gitops push
If the same setting was changed on both sides to different values, reconcile stops without changing either; keep one of the two changes and run it again.
For the primary wiki you can instead use canasta config set MW_SITE_FQDN=newdomain.example.com, which records the change in hosts/<host>/vars.yaml (as well as the rendered files) for you; follow it with canasta gitops push.
Port changes
Listening ports are a Docker Compose concept: the port is set in .env and mapped by the Compose stack. On Kubernetes the Ingress always serves on ports 80 and 443 and there is no per-instance port setting, so canasta config set HTTP_PORT/HTTPS_PORT is rejected on a Kubernetes instance β expose a different external port at the load balancer or Ingress controller instead. An env file passed to canasta create for a Kubernetes instance may still set them, for example one shared with Compose instances: create writes them to .env with a warning that they do not apply.
On Compose, the HAProxy edge serves each instance on its own HTTP_PORT and HTTPS_PORT. Instances on one host can share ports, since the edge routes by hostname, so a port change is needed only for an instance that cannot share, such as a second instance reached by localhost or an IP address.
On Compose, changing the port is a separate operation from changing the domain, and unlike the domain it is instance-wide: every wiki in the instance shares the same listening port. There is no per-wiki port β a non-primary wiki cannot listen on a different port than the primary wiki. To change the port for the whole instance, run:
canasta config set HTTPS_PORT=<port>
This cascades automatically, appending the new port to the URLs of all wikis in config/wikis.yaml as well as to MW_SITE_SERVER and MW_SITE_FQDN (which take their domain from the primary wiki). Setting the port back to the scheme default (443 for HTTPS, 80 for HTTP) removes the suffix again. (Set HTTP_PORT instead if the instance runs with TLS_MODE=off, in which case the plain-HTTP port is the active one.) See Running on non-standard ports.
Because the domain and port cascades are independent, changing both at once means running both commands β set the domain (MW_SITE_FQDN, or a non-primary wiki's url in config/wikis.yaml) and set the port (HTTPS_PORT); neither replaces the other.
On a gitops-managed instance the rendered config/wikis.yaml and .env are rewritten the same way, but because those files are regenerated the durable change is recorded to hosts/<host>/vars.yaml: https_port (the raw port number), the derived mw_site_fqdn/mw_site_server, and a wiki_url_<id> entry for every wiki β each carrying the new port suffix. Without this the next gitops pull would revert the port. Follow the change with canasta gitops push.
Redirecting legacy URL paths
When migrating an existing wiki into Canasta, the URL shape your readers and external links know may not match what Canasta produces. For example, a wiki that ran at the document root ($wgScriptPath = "") served pages at https://example.com/index.php?title=Page_Name; in Canasta, those same pages live at https://example.com/wiki/Page_Name. External links and bookmarks to the old URLs will return 404 unless you redirect them.
Caddy handles these redirects at the reverse proxy layer. Add a redirect rule to config/Caddyfile.site that matches the old URL pattern and rewrites it to the new one. (See Caddyfile, Caddyfile.site, and Caddyfile.global for how Caddyfile.site fits into the stack β it takes the place of .htaccess in an Apache-based install.)
Example: redirect /index.php?title=X to /wiki/X
If the wiki previously served pages at /index.php?title=Page_Name (no /w/ prefix, no path-rewrite layer), add this to config/Caddyfile.site:
@legacyTitle {
path /index.php
query title=*
}
redir @legacyTitle /wiki/{http.request.uri.query.title} 301
After saving the file, restart the instance:
canasta restart
https://example.com/index.php?title=My_Page now issues a 301 redirect to https://example.com/wiki/My_Page, preserving the link target.
Notes
- Use a 301 (permanent) redirect for URLs that are genuinely retiring; use 302 (temporary) if you might revert.
- Caddy's matchers and
redirdirective are documented at caddyserver.com/docs/caddyfile/directives/redir. Most legacy URL patterns are expressible with one or two matchers and aredir. - If migrating an entire URL scheme (not just a few paths), be cautious about wildcard fallbacks at the end of the site block β they can mask legitimate 404s.
Very short URLs
By default a Canasta wiki serves pages at /wiki/Page_Name β the standard "short URL" pattern documented in Manual:Short URL on mediawiki.org. Canasta also supports an optional "very short URL" mode that drops the /wiki/ prefix, so pages live directly at /Page_Name.
Enable it with:
canasta config set CANASTA_ENABLE_VERY_SHORT_URLS=true
This restarts the instance and reconfigures Caddy and MediaWiki so the wiki "owns" the entire URL space at the root.
Constraints
Because very short URLs put pages at the root path, they conflict with anything else that uses root paths on the same hostname. canasta config set validates these constraints before enabling and refuses with an actionable error if any are violated:
- Each wiki must be on a unique hostname. Path-based wiki farm entries (e.g.
example.com/docsinwikis.yaml) are not allowed when very short URLs are on. Each wiki'surlmust be a hostname only, with no path component. CANASTA_ENABLE_WIKI_DIRECTORYmust be off. The wiki directory is served at/wikis, which would collide with a page titledWikisunder root-relative URLs.
To switch a multi-wiki instance from path-based to hostname-based wikis before enabling very short URLs, see Changing the domain name above.
Disabling
canasta config set CANASTA_ENABLE_VERY_SHORT_URLS=false
After disabling, page URLs revert to the standard /wiki/Page_Name form. Existing page titles are unaffected β only the URL routing changes.
Object cache
By default, MediaWiki's main object cache is APCu, which the web server does not share with maintenance scripts. An edit made by a maintenance script can stay invisible on the web until the web container restarts.
Enable Redis to give the web server and maintenance scripts one shared cache:
canasta config set -i myinstance CANASTA_ENABLE_REDIS=true
This adds a redis container, or a redis Deployment and Service on Kubernetes, and restarts the instance. The web container then uses Redis at redis:6379 as the main cache. Setting the flag back to false removes Redis, and the cache returns to APCu.
Redis holds up to CANASTA_REDIS_MEMORY megabytes (64 by default). When it is full, it evicts the least recently used keys. It keeps nothing on disk, so it starts empty after a restart, and the wiki refills it as pages are viewed. To give it more room:
canasta config set -i myinstance CANASTA_REDIS_MEMORY=256
Sessions are stored in the database, not the object cache, so users stay logged in across restarts and upgrades, with or without Redis. A wiki that sets $wgSessionCacheType itself keeps that store; with CACHE_DB, its users are logged out whenever update.php runs.
Settings in config/settings/ load after Canasta's defaults. A wiki that sets $wgMainCacheType itself keeps that cache. Remove the setting for the wiki to use the flag.
An instance with its own Redis
On Docker Compose, a redis service in docker-compose.override.yml, or a sidecar named redis, merges into Canasta's redis service. Your image, command and volumes take precedence. The merged service runs only while CANASTA_ENABLE_REDIS is true, so canasta upgrade sets the flag for an instance that has one, and that Redis keeps running. A new sidecar cannot be named redis.
Other setups need a change before you enable the flag:
- A service under another name with the network alias
redis: the alias conflicts with Canasta's service. Remove the alias, or merge the service into Canasta's by renaming it toredis. - Redis on the host, or a managed Redis service: leave the flag off and set
$wgObjectCachesand$wgMainCacheTypein your settings. - Kubernetes: a sidecar or Service of your own named
redisconflicts with Canasta's. Rename yours, and update the settings that point at it, before enabling the flag.
PHP and upload limits
The web container's PHP settings come from the instance's .env, so you change them with canasta config set rather than by editing a php.ini, which a new image would replace. Each change restarts the instance (see Applying configuration changes).
| Setting | Default | Meaning |
|---|---|---|
PHP_UPLOAD_MAX_FILESIZE |
10M |
Largest file one upload may send |
PHP_POST_MAX_SIZE |
10M |
Largest request body PHP accepts; keep it at least PHP_UPLOAD_MAX_FILESIZE
|
PHP_MAX_INPUT_VARS |
1000 |
Most input variables (form fields and query parameters) one request may send |
PHP_MEMORY_LIMIT |
256M |
Memory each PHP request may use |
PM_MAX_CHILDREN |
25 |
Most PHP-FPM workers, and so the most PHP requests the web container handles at once |
PM_START_SERVERS |
10 |
PHP-FPM workers started with the container |
PM_MIN_SPARE_SERVERS |
5 |
Fewest idle PHP-FPM workers |
PM_MAX_SPARE_SERVERS |
15 |
Most idle PHP-FPM workers |
PM_MAX_REQUESTS |
2500 |
Requests each PHP-FPM worker serves before PHP-FPM replaces it, which frees memory a long-running worker has leaked; 0 never replaces a worker
|
To accept uploads of up to 100 MB:
canasta config set -i myinstance PHP_UPLOAD_MAX_FILESIZE=100M PHP_POST_MAX_SIZE=100M
MediaWiki applies its own cap, $wgMaxUploadSize, which is 100 MB unless you set it in a settings file under config/settings/; to accept larger files, raise both.
Each PHP-FPM worker can use up to PHP_MEMORY_LIMIT, so PM_MAX_CHILDREN times PHP_MEMORY_LIMIT should fit in the memory available to the web container. PHP-FPM refuses to start a pool whose numbers contradict each other, and the wiki then answers 503, so canasta config set refuses a change that would make PM_MAX_SPARE_SERVERS greater than PM_MAX_CHILDREN, or put PM_START_SERVERS outside the spare range. To allow more requests at once on a host with memory to spare:
canasta config set -i myinstance PM_MAX_CHILDREN=50
On Docker Compose the HAProxy edge sizes its connection caps for the instance from PM_MAX_CHILDREN, so they follow this change (see Rate limits and connection caps). On Kubernetes each web replica has a pool of its own; see Multi-node Kubernetes for adding replicas.
The image also reads PHP_MAX_EXECUTION_TIME and PHP_MAX_INPUT_TIME, the seconds a request may run and may take to send its input; both default to 60. Canasta does not pass these to the web container on its own, so set them with --web:
canasta config set -i myinstance --web PHP_MAX_EXECUTION_TIME=110 PHP_MAX_INPUT_TIME=110
A longer limit does not let a request outlast Varnish, which stops waiting for a response after 120 seconds (first_byte_timeout in config/default.vcl).
Job queue
MediaWiki defers work such as link table updates, search index updates and email notifications to its job queue. The web container runs a job runner for each wiki that works through the queue in a loop:
- It runs the job types that need to happen promptly:
enotifNotify,createPage,refreshLinksandhtmlCacheUpdate. - It runs a batch of all other jobs, for up to
MW_JOB_RUNNER_MAXTIMEseconds. - It pauses for
MW_JOB_RUNNER_PAUSEseconds, so the job runner leaves room for web requests.
The batch is bounded by time so that a long queue drains: on a busy wiki, jobs can arrive faster than a short batch completes them. A job is never interrupted; once the time limit passes, the batch finishes the job it is running and starts no more. An empty queue ends the batch at once.
These settings control the job runner:
| Setting | Default | Meaning |
|---|---|---|
MW_ENABLE_JOB_RUNNER |
true |
Run the job runner |
MW_JOB_RUNNER_MAXTIME |
60 |
Seconds each batch may run; 0 means no time limit
|
MW_JOB_RUNNER_MAXJOBS |
(unset) | Maximum jobs per batch; unset means no count limit |
MW_JOB_RUNNER_PAUSE |
2 |
Seconds the job runner pauses between loops |
MW_JOB_RUNNER_MEMORY_LIMIT |
512M |
PHP memory limit for the job runner |
With both MW_JOB_RUNNER_MAXTIME and MW_JOB_RUNNER_MAXJOBS set, a batch stops at whichever limit it reaches first. A longer time limit spends more of each loop on the batch, and delays the prompt job types by up to that long when the queue is busy.
To limit each batch to a number of jobs instead of a length of time, turn off the time limit and set a count:
canasta config set -i myinstance MW_JOB_RUNNER_MAXTIME=0 MW_JOB_RUNNER_MAXJOBS=10
To return to the defaults, unset both:
canasta config unset -i myinstance MW_JOB_RUNNER_MAXTIME MW_JOB_RUNNER_MAXJOBS
Both commands restart the instance to apply the change (see Applying configuration changes). To see how many jobs are waiting on each wiki, by type:
canasta maintenance script -i myinstance showJobs --group
canasta doctor reports each wiki whose queue holds more than CANASTA_DOCTOR_JOB_BACKLOG jobs (10,000 by default), with its largest job types. A queue that keeps growing usually means the job runner is off or a job type keeps failing.