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
- Enable the console by starting Dockge with the console enabled (e.g. remove --disable-console / set enableConsole: true in config)
- If the console should stay disabled, do not expose or call the console UI feature
- Use per-stack interactive terminals instead of the combined console
- 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
- Check enableConsole in the server config before exposing any console UI
- Start Dockge without console-disabling flags if you need the combined terminal
- Hide the console feature in the frontend when the server reports it disabled
- Remember the console grants full shell access — keep it off on shared hosts unless needed
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
- Console is not enabled.
- Terminal name must be a string.
- Command must be a string.
- Terminal not found or it is not a Interactive Terminal.
- Stack name must be a string.
AI-assisted analysis of louislam/dockge@f809ae192b (2026-08-31).
Data as JSON: /api/errors/575c61ec14d455ac.
Report an issue: GitHub.