Where Does code-server Store Config and Data?
code-server reads bind, auth and password from config.yaml in the XDG config dir, with data and extensions under local share.
Last updated
code-server splits server from editor state. config.yaml (bind address, auth mode, password, cert) lives in the XDG config dir and maps one to one onto CLI flags. Extensions, settings, logs and the heartbeat live under local share.
That split decides backups: the yaml recreates access, the data dir recreates the workspace. Copying ~/.vscode over the data dir even imports desktop VS Code extensions and settings in one move.
Where code-server stores this, by platform
~/.config/code-server/config.yaml
Bind, auth, password, cert. Created with a random password on first start. XDG_CONFIG_HOME respected; flags override file values.
~/.config/code-server/config.yaml
Same config path. Extensions in ~/.local/share/code-server/extensions, logs in coder-logs, heartbeat file for idle shutdown timers.
Frequently asked questions
How do I change the code-server password?
Edit the password field in config.yaml and restart (systemctl restart code-server@$USER for service installs). For hashed storage, set hashed-password with an argon2 hash instead.
Can the config file live elsewhere?
Pass --config <path> or set CODE_SERVER_CONFIG. Flags still beat the file, so ad-hoc port or auth changes never require editing it.
Notice an outdated path? Let us know.