# Program configs

> Add and edit supervisord program configs from Laravel queue worker, Horizon or scheduler templates. Visor explains each line, checks it, diffs and backs it up.

Source: https://getvisor.dev/docs/configs/
Author: Touhidur Rahman (https://touhidurabir.github.io/)

Visor adds, edits and removes the program files in your include folder, the folder of the first `[include] files=` pattern in supervisord.conf. It explains each file, checks it before saving, keeps a backup of every change, and applies it the way `supervisorctl update` does.

## Add a new config

Click **Add new** on the dashboard or press ⌘N. There are three ways to add it:

- **Write it**: type the file in an editor with INI highlighting, and name it. The explanation beside it follows as you type.
- **Fill a form**: fields grouped as Basics, Starting and restarting, Stopping, and Logs and environment. The file it will write shows as you go. **Switch to writing it by hand** keeps what you entered.
- **Import files**: bring in config files you already have, from a repo or written by an assistant. See [Import files](https://getvisor.dev/docs/configs/#import-files) below.

The form can start from a template: **Laravel queue worker**, **Laravel Horizon**, **Laravel scheduler**, **Node app** or **Any script**. Paths under `/srv/acme` and the names are placeholders; change them to match your project.

**Copy an existing config…** starts from one of your files. Its programs get new names, with `-copy`, so both can run, and **Check the copy** lists anything to look at. Nothing is written until you save.

**Save & apply** writes the file and loads its programs into supervisord in one step.

### Import files

Click **Choose files…**, or drop `.ini` or `.conf` files anywhere on Visor’s window, which opens this page too. Each file gets a card with the name it will have, its status and **Edit**, which opens it in the editor with the explanation beside it. Visor checks the files together, then adds them in one go. Tick **Start them after adding** to start their programs too. The originals are only read.

A file is renamed to the extension your include folder uses, so `web.conf` becomes `web.ini` when supervisord loads `*.ini` files. A file you pick gets the usual permissions, `0644`. A dropped file, or a copy of an existing config, keeps its original’s permissions, except that Visor’s copy is always readable and writable by you and never writable by the group or others.

## What this config does

Every config gets an explanation, card by card: one card per program or section, with its live state and one sentence on what it does. It says *From the file, no AI* because that’s how it’s made: Visor reads the settings and words them itself.

![A config’s explanation: a summary of 1 error and 2 suggestions, Expand all, Collapse all and Only problems, then one card per program; the failing mailer-digest card is open, showing why it can’t run, the line that caused it with Edit line 9, and a suggestion to set both log paths](https://getvisor.dev/docs/shots/config-explain-light.webp)

Open a card to see each line beside its meaning, any problem with **How to fix**, and **Apply fix** when the fix is one exact change. Every file or folder a line points to is checked on disk and can be opened from there. **Only problems** hides the lines that are fine; **Expand all** and **Collapse all** open and close every card.

You see it on a config’s Overview tab, beside the editor, and while you add a new one. **Describe** in a config’s ⋯ menu opens it too.

## Checks before saving

Visor checks a file before it saves it. Errors block saving; warnings don’t. **Validate** in the editor runs the checks on demand. They include:

- the program name is unique across your include folder;
- there’s a `command=`, and the program it runs exists;
- settings supervisord knows, with values of the right type (unknown keys are a warning);
- with `numprocs` above 1, `process_name` contains `%(process_num)`;
- the `directory` and the `user` exist, and log folders exist and are writable;
- the file name matches the include pattern, so supervisord will load it.

What each setting does, and what changing it does to your program, is in [Every supervisord option, explained](https://getvisor.dev/guides/supervisord-config-options/).

## The editor

A config’s **Config** tab is the editor, with the explanation beside it. The checks follow as you type, and a line number jumps to its line. A save bar stays at the bottom of the window with the file’s status, and its Save button says what it waits for, such as *Fix line 4 to save*. **Copy** puts the config’s text on the clipboard, with your edits.

![The Config tab for notes.ini: the editor on the left, the explanation of each line on the right, and the save bar at the bottom of the window](https://getvisor.dev/docs/shots/config-editor-light.webp)

## Saving, the diff and backups

Saving an edit shows **Review the change** first: a diff with removed lines marked **−** and added lines marked **+**. Confirm with **Save & apply**.

Before every write, Visor keeps a copy of the file as it was, in its own backups folder outside your include folder. It writes the new file in one step, so a crash leaves the old file or the new one, never half of each.

If the file changed on disk while you were editing, Visor doesn’t save over it. It shows **Your edits vs. the file on disk**, and you choose **Keep my edits**, **Load the new version** or **Copy my edits**.

## Restoring a backup

**Restore a backup…** in the editor lists every copy Visor saved of that file, newest first, each with the change restoring it would make. **Restore this version** goes through the same checks, backup and apply as a save.

A config you removed from supervisor appears under **Recently removed** on the dashboard, with **Restore**.

## How applying works

Applying is the same as `supervisorctl update`. Visor asks supervisord to re-read its config files, then, group by group:

- **Added**: loads it. Programs with autostart on start.
- **Changed**: stops it, removes it and adds it again, so it restarts with the new settings.
- **Removed**: stops it and removes it.

Before it applies, Visor shows what will happen, for example *Changed: acme-queue. They restart with the new settings.* Afterwards it reports what it did, such as *Applied: 1 added, 2 restarted.* When the file has a `[group:]` section, the save preview says so: supervisord restarts a changed group as a whole, so every process in it restarts. **Check for changes** (⌘R) only looks, like `supervisorctl reread`. **Apply changes** on one config touches only that file’s programs; everything else keeps running.

## Configs on a server

On a [server’s tab](https://getvisor.dev/docs/remote-servers/#configs-on-a-server), configs work the same way: the checks look on the server, and the backups stay on your computer. A **Production** server asks before a change applies, and a **Read only** server changes nothing.

## What Visor never edits

Visor only writes program files in your include folder. It never edits supervisord.conf itself or its `[supervisord]` section. If the folder isn’t writable for you, Visor still shows and controls everything, and Doctor explains how to allow editing.