louislam/dockge · error · Error

Console is not enabled.

Error message

Console is not enabled.

What it means

The MainTerminal constructor in backend/terminal.ts refuses to create the combined/main console terminal unless server.config.enableConsole is true. Dockge disables the shared console by default for security — it grants shell access on the server — so constructing a MainTerminal when the flag is off throws this error immediately, before any shell selection happens.

Source

Thrown at backend/terminal.ts:275

        this.ptyProcess?.write(input);
    }

    resetCWD() {
        const cwd = process.cwd();
        this.ptyProcess?.write(`cd "${cwd}"\r`);
    }
}

/**
 * User interactive terminal that use bash or powershell with limited commands such as docker, ls, cd, dir
 */
export class MainTerminal extends InteractiveTerminal {
    constructor(server : DockgeServer, name : string) {
        let shell;

        // Throw an error if console is not enabled
        if (!server.config.enableConsole) {
            throw new Error("Console is not enabled.");
        }

        if (os.platform() === "win32") {
            if (commandExistsSync("pwsh.exe")) {
                shell = "pwsh.exe";
            } else {
                shell = "powershell.exe";
            }
        } else {
            shell = "bash";
        }
        super(server, name, shell, [], server.stacksDir);
    }

    public write(input : string) {
        super.write(input);
    }
}

View on GitHub (pinned to f809ae192b)

Solutions

  1. Enable the console by starting Dockge with the console enabled (e.g. remove --disable-console / set enableConsole: true in config)
  2. If the console should stay disabled, do not expose or call the console UI feature
  3. Use per-stack interactive terminals instead of the combined console
  4. Check the Dockge startup flags/environment to confirm the intended console setting

Example fix

// before (server started with console disabled)
const terminal = new MainTerminal(server, name);
// after (guard on config)
if (server.config.enableConsole) {
  const terminal = new MainTerminal(server, name);
} else {
  throw new FriendlyError("Console is disabled on this Dockge instance.");
}
Defensive patterns

Strategy: type-guard

Validate before calling

// before creating a MainTerminal
if (!server.config.enableConsole) {
  // hide the console button / skip the call
  return;
}
const terminal = new MainTerminal(server, name);

Type guard

function consoleAvailable(server) {
  return typeof server.config?.enableConsole === "boolean" && server.config.enableConsole;
}

Try / catch

let terminal;
try {
  terminal = new MainTerminal(server, name);
} catch (e) {
  if (e.message === "Console is not enabled.") {
    showNotice("Console is disabled on this instance. Enable it in the server config.");
  } else throw e;
}

Prevention

When it happens

Trigger: Any code path (e.g. joining the combined console terminal from the frontend) that instantiates MainTerminal while `enableConsole` is false in the Dockge server config (default), or via --disable-console / console disabled environment.

Common situations: Users upgrading Dockge and clicking the console button without knowing the console was disabled; deployments that intentionally disable console for security; reverse-proxy setups where the console endpoint was expected to work.

Related errors


AI-assisted analysis of louislam/dockge@f809ae192b (2026-08-31). Data as JSON: /api/errors/575c61ec14d455ac. Report an issue: GitHub.