Code-server: How to change the password

Created on 20 Apr 2019  路  12Comments  路  Source: cdr/code-server

How can I change the password used to authenticate into code-server?

Most helpful comment

If you're using the binary, the latest version of 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

If you're using older versions, you can use the --password argument.

./code-server --allow-http --password "yourpassword"

docker run -it -p 127.0.0.1:8443:8443 -v "${PWD}:/home/coder/project" codercom/code-server --allow-http --password "yourpassword"

You can find the documentation here:
https://github.com/codercom/code-server/blob/master/doc/self-hosted/index.md

All 12 comments

If you're using the binary, the latest version of 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

If you're using older versions, you can use the --password argument.

./code-server --allow-http --password "yourpassword"

docker run -it -p 127.0.0.1:8443:8443 -v "${PWD}:/home/coder/project" codercom/code-server --allow-http --password "yourpassword"

You can find the documentation here:
https://github.com/codercom/code-server/blob/master/doc/self-hosted/index.md

@mbayabo Why add the parameter of --no-auth?

@mbayabo Why add the parameter of --no-auth?

You actually don't need that, sorry.

Using the --password option in Docker, code-server complains that it don't recognize the command line option and refuses to start.

Using the --password option in Docker, code-server complains that it don't recognize the command line option and refuses to start.

If you're using the newest release, the --password argument has been deprecated. It won't work anymore. You need to set an environment variable called PASSWORD.

export PASSWORD="yourpassword"

@mbayabo Thanks! That works for me!

This should be added to the self-hosted guide. Do we want to do that as a new issue?

This should be added to the self-hosted guide. Do we want to do that as a new issue?

If you actually read the self-hosted guide you would have seen it's already in there bro...
Code-Server Usage

This should be added to the self-hosted guide. Do we want to do that as a new issue?

If you actually read the self-hosted guide you would have seen it's already in there bro...
Code-Server Usage

I must be missing where it says the updated details about environment variables that were introduced in 1.903-vsc1.33.1

This should be added to the self-hosted guide. Do we want to do that as a new issue?

If you actually read the self-hosted guide you would have seen it's already in there bro...
Code-Server Usage

I must be missing where it says the updated details about environment variables that were introduced in 1.903-vsc1.33.1

My bad, I thought you were talking about the old method of setting passwords

no worries

We probably should add it as an issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tecosaur picture tecosaur  路  3Comments

RealSlimMahdi picture RealSlimMahdi  路  3Comments

chrischabot picture chrischabot  路  3Comments

avelino picture avelino  路  3Comments

korzq picture korzq  路  3Comments