# First run and Doctor

> Doctor is the checklist Visor shows on first run and whenever it can’t connect: what each check looks at and how to fix what it finds.

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

Doctor is the checklist Visor shows the first time it opens, and whenever it can’t connect. It says what it found, what’s wrong and what to run. It never installs anything, runs sudo or asks for your password.

## Opening Doctor

On first launch, Doctor fills the window. After that, open it from **Doctor** in the sidebar, from the Mac’s menu bar (**Visor › Doctor** or **Help › Doctor**), or click **Open Doctor** on the card the dashboard and the menu-bar popover show when Visor isn’t connected.

Every fix ends with **Check again**, which runs all five checks from the top.

On Linux, Doctor shows your distribution’s commands instead of Homebrew’s, and has its own fix for a supervisord that runs as root. [Install on Linux](https://getvisor.dev/docs/install-linux/#if-supervisord-runs-as-root) walks through it.

## The five checks

Each check shows one of three words: **Done**, **Needs attention**, or **Waiting** when a check above it failed. The ring beside them reads *5 of 5 checks passed*, or how many things are left to fix.

![Doctor with one thing to fix: supervisord running needs attention because nothing is listening on the socket, three checks are done and one waits, and the fix card offers Start supervisord and Check again](https://getvisor.dev/docs/shots/doctor-light.webp)

Doctor checks:

| Check | What Visor looks at |
| --- | --- |
| supervisord installed | Your PATH and Homebrew. If it isn’t there but supervisord answers anyway, this reads *Not on your PATH, but it’s running*. |
| Config file found | `/opt/homebrew/etc/supervisord.conf`, `/usr/local/etc/supervisord.conf`, `/etc/supervisord.conf` and `/etc/supervisor/supervisord.conf`, or the file you chose. |
| supervisord running | The socket or port in the config’s `[unix_http_server]` or `[inet_http_server]` section, with the username and password if it needs them. |
| Config folder writable | The folder of the first `[include] files=` pattern, where new programs go. |
| Processes found | What supervisord runs. When it passes, the line reads like *12 processes in 4 configs*. |

## When everything passes

Doctor says **Your Mac is ready** (*Your computer is ready* on Linux). On first run it offers two switches, both on: **Open Visor when I log in** and **Notify me when a watched process fails**. Click **Open dashboard** to start. Visor also lives in your menu bar.

> **Move Visor to Applications first**
>
> If Visor runs from the disk image or Downloads, Doctor asks you to quit it, drag it into Applications and open it from there. Until then the login switch stays off.

## What each result means

### supervisord isn’t installed yet

Visor needs supervisord on this Mac first. Run these in Terminal, then check again:

```sh
brew install supervisor
brew services start supervisor
```

If it’s installed somewhere Visor didn’t look, click **It’s installed somewhere else…** and point Visor to its config.

### Where is your config?

supervisord is installed, but its config isn’t in any of the usual places. Type the path or click **Choose…**, then **Use this config**. Visor remembers it. **Where Visor looked** lists the places it tried.

### supervisord isn’t running

Everything is in place, but supervisord is stopped. **Start supervisord** starts it as you, never with sudo. For Homebrew’s own config it runs `brew services start supervisor`, so it also starts after a restart; for any other config it runs `supervisord -c` with your config once.

A config with `nodaemon=true` keeps supervisord in the foreground, so Visor doesn’t start it. Doctor shows the command to run instead. If a start fails, Doctor shows what supervisord printed and the end of its log, with the usual causes: a mistake in the config, another supervisord already on the socket, or a file left over from a crash.

### supervisord won’t let Visor in

supervisord is running, but its socket belongs to root, usually because it was started with sudo. Doctor offers three ways out. Pick one, then check again:

1. **Run supervisord as yourself** (recommended): stop the copy root started and start it again as you.

   ```sh
   sudo brew services stop supervisor
   brew services start supervisor
   ```

2. **Open the socket to your user**: add two lines under `[unix_http_server]` in supervisord.conf, then restart supervisord.

   ```ini
   chown=[YOUR USER]:staff
   chmod=0770
   ```

3. **Use a local port with a password**: add an `[inet_http_server]` section, restart supervisord, and enter the password in Settings.

   ```ini
   [inet_http_server]
   port=127.0.0.1:9001
   username=visor
   password=choose-one
   ```

Visor never runs sudo or changes these files for you.

### supervisord wants a password

supervisord turned down the username and password Visor used. Click **Open Settings**, enter the ones from your supervisord.conf, then check again.

### Visor can watch, but not edit

supervisord is running and Visor can control it, but the folder your programs live in isn’t writable for you, so adding and editing configs is off. Everything else works: watching, starting, stopping and logs. Doctor shows the command that makes the folder yours:

```sh
sudo chown -R $(whoami) [CONFIG FOLDER]
```

If the folder doesn’t exist yet, it shows `mkdir -p` with the folder instead. **Open dashboard anyway** skips this for now.

Still stuck after Doctor’s checks? [Troubleshooting](https://getvisor.dev/docs/troubleshooting/) starts from the error supervisorctl prints and gives the fix, with or without Visor.