diff --git a/doc/self-hosted/index.md b/doc/self-hosted/index.md index 9f73cd47543f..7719f1919bc5 100644 --- a/doc/self-hosted/index.md +++ b/doc/self-hosted/index.md @@ -50,10 +50,22 @@ Options: -p, --port Port to bind on. (default: 8443) -N, --no-auth Start without requiring authentication. -H, --allow-http Allow http connections. - -P, --password Specify a password for authentication. + -P, --password DEPRECATED: Use the PASSWORD environment variable instead. Specify a password for authentic +ation. --disable-telemetry Disables ALL telemetry. --help output usage information ``` + + ### Password + Since version 1.903-vsc1.33.1, code-server allows you to set an environment variable PASSWORD. + +``` +export PASSWORD="yourpassword" +./code-server --allow-http +``` +If you're using docker, you can use the -e flag to pass environment variables to your container + +`docker run -it -p 127.0.0.1:8443:8443 -e PASSWORD='yourpassword' -v "${PWD}:/home/coder/project" codercom/code-server --allow-http` ### Data Directory Use `code-server -d (path/to/directory)` or `code-server --data-dir=(path/to/directory)`, excluding the parentheses to specify the root folder that VS Code will start in.