</span></code></pre></div><h3id=hashed-code-server-password>Hashed code-server password<aclass=headerlinkhref=#hashed-code-server-passwordtitle="Permanent link">¶</a></h3><p>How to create the <ahref=https://github.com/cdr/code-server/blob/master/docs/FAQ.md#can-i-store-my-password-hashed>hashed password</a>.</p><h2id=usage>Usage<aclass=headerlinkhref=#usagetitle="Permanent link">¶</a></h2><p>To help you get started creating a container from this image you can either use docker-compose or the docker cli.</p><h3id=docker-compose-recommended-click-here-for-more-info>docker-compose (recommended, <ahref=https://docs.linuxserver.io/general/docker-compose>click here for more info</a>)<aclass=headerlinkhref=#docker-compose-recommended-click-here-for-more-infotitle="Permanent link">¶</a></h3><divclass="language-yaml highlight"><pre><span></span><code><spanid=__span-1-1><aid=__codelineno-1-1name=__codelineno-1-1href=#__codelineno-1-1></a><spanclass=nn>---</span>
</span></code></pre></div><h3id=docker-cli-click-here-for-more-info>docker cli (<ahref=https://docs.docker.com/engine/reference/commandline/cli/>click here for more info</a>)<aclass=headerlinkhref=#docker-cli-click-here-for-more-infotitle="Permanent link">¶</a></h3><divclass="language-bash highlight"><pre><span></span><code><spanid=__span-2-1><aid=__codelineno-2-1name=__codelineno-2-1href=#__codelineno-2-1></a>docker<spanclass=w></span>run<spanclass=w></span>-d<spanclass=w></span><spanclass=se>\</span>
</span></code></pre></div><h2id=parameters>Parameters<aclass=headerlinkhref=#parameterstitle="Permanent link">¶</a></h2><p>Docker images are configured using parameters passed at runtime (such as those above). These parameters are separated by a colon and indicate <code><external>:<internal></code> respectively. For example, <code>-p 8080:80</code> would expose port <code>80</code> from inside the container to be accessible from the host's IP on port <code>8080</code> outside the container.</p><h3id=ports-p>Ports (<code>-p</code>)<aclass=headerlinkhref=#ports-ptitle="Permanent link">¶</a></h3><table><thead><tr><thstyle="text-align: center;">Parameter</th><th>Function</th></tr></thead><tbody><tr><tdstyle="text-align: center;"><code>8443</code></td><td>web gui</td></tr></tbody></table><h3id=environment-variables-e>Environment Variables (<code>-e</code>)<aclass=headerlinkhref=#environment-variables-etitle="Permanent link">¶</a></h3><table><thead><tr><thstyle="text-align: center;">Env</th><th>Function</th></tr></thead><tbody><tr><tdstyle="text-align: center;"><code>PUID=1000</code></td><td>for UserID - see below for explanation</td></tr><tr><tdstyle="text-align: center;"><code>PGID=1000</code></td><td>for GroupID - see below for explanation</td></tr><tr><tdstyle="text-align: center;"><code>TZ=Etc/UTC</code></td><td>specify a timezone to use, see this <ahref=https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List>list</a>.</td></tr><tr><tdstyle="text-align: center;"><code>PASSWORD=password</code></td><td>Optional web gui password, if <code>PASSWORD</code> or <code>HASHED_PASSWORD</code> is not provided, there will be no auth.</td></tr><tr><tdstyle="text-align: center;"><code>HASHED_PASSWORD=</code></td><td>Optional web gui password, overrides <code>PASSWORD</code>, instructions on how to create it is below.</td></tr><tr><tdstyle="text-align: center;"><code>SUDO_PASSWORD=password</code></td><td>If this optional variable is set, user will have sudo access in the code-server terminal with the specified password.</td></tr><tr><tdstyle="text-align: center;"><code>SUDO_PASSWORD_HASH=</code></td><td>Optionally set sudo password via hash (takes priority over <code>SUDO_PASSWORD</code> var). Format is <code>$type$salt$hashed</code>.</td></tr><tr><tdstyle="text-align: center;"><code>PROXY_DOMAIN=code-server.my.domain</code></td><td>If this optional variable is set, this domain will be proxied for subdomain proxying. See <ahref=https://github.com/cdr/code-server/blob/master/docs/FAQ.md#sub-domains>Documentation</a></td></tr><tr><tdstyle="text-align: center;"><code>DEFAULT_WORKSPACE=/config/workspace</code></td><td>If this optional variable is set, code-server will open this directory by default</td></tr></tbody></table><h3id=volume-mappings-v>Volume Mappings (<code>-v</code>)<aclass=headerlinkhref=#volume-mappings-vtitle="Permanent link">¶</a></h3><table><thead><tr><thstyle="text-align: center;">Volume</th><th>Function</th></tr></thead><tbody><tr><tdstyle="text-align: center;"><code>/config</code></td><td>Contains all relevant configuration files.</td></tr></tbody></table><h4id=miscellaneous-options>Miscellaneous Options<aclass=headerlinkhref=#miscellaneous-optionstitle="Permanent link">¶</a></h4><table><thead><tr><thstyle="text-align: center;">Parameter</th><th>Function</th></tr></thead><tbody><tr><td></td><td></td></tr></tbody></table><h2id=environment-variables-from-files-docker-secrets>Environment variables from files (Docker secrets)<aclass=headerlinkhref=#environment-variables-from-files-docker-secretstitle="Permanent link">¶</a></h2><p>You can set any environment variable from a file by using a special prepend <code>FILE__</code>.</p><p>As an example:</p><divclass="language-bash highlight"><pre><span></span><code><spanid=__span-3-1><aid=__codelineno-3-1name=__codelineno-3-1href=#__codelineno-3-1></a>-e<spanclass=w></span><spanclass=n
</span></code></pre></div><p>Will set the environment variable <code>PASSWORD</code> based on the contents of the <code>/run/secrets/mysecretpassword</code> file.</p><h2id=umask-for-running-applications>Umask for running applications<aclass=headerlinkhref=#umask-for-running-applicationstitle="Permanent link">¶</a></h2><p>For all of our images we provide the ability to override the default umask settings for services started within the containers using the optional <code>-e UMASK=022</code> setting. Keep in mind umask is not chmod it subtracts from permissions based on it's value it does not add. Please read up <ahref=https://en.wikipedia.org/wiki/Umask>here</a> before asking for support.</p><h2id=user-group-identifiers>User / Group Identifiers<aclass=headerlinkhref=#user-group-identifierstitle="Permanent link">¶</a></h2><p>When using volumes (<code>-v</code> flags), permissions issues can arise between the host OS and the container, we avoid this issue by allowing you to specify the user <code>PUID</code> and group <code>PGID</code>.</p><p>Ensure any volume directories on the host are owned by the same user you specify and any permissions issues will vanish like magic.</p><p>In this instance <code>PUID=1000</code> and <code>PGID=1000</code>, to find yours use <code>id user</code> as below:</p><divclass="language-bash highlight"><pre><span></span><code><spanid=__span-4-1><aid=__codelineno-4-1name=__codelineno-4-1href=#__codelineno-4-1></a><spanclass=w></span>$<spanclass=w></span>id<spanclass=w></span>username
</span></code></pre></div><h2id=docker-mods>Docker Mods<aclass=headerlinkhref=#docker-modstitle="Permanent link">¶</a></h2><p><ahref="https://mods.linuxserver.io/?mod=code-server"title="view available mods for this container."><imgalt="Docker Mods"src="https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=code-server&query=%24.mods%5B%27code-server%27%5D.mod_count&url=https%3A%2F%2Fraw.githubusercontent.com%2Flinuxserver%2Fdocker-mods%2Fmaster%2Fmod-list.yml"></a><ahref="https://mods.linuxserver.io/?mod=universal"title="view available universal mods."><imgalt="Docker Universal Mods"src="https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=universal&query=%24.mods%5B%27universal%27%5D.mod_count&url=https%3A%2F%2Fraw.githubusercontent.com%2Flinuxserver%2Fdocker-mods%2Fmaster%2Fmod-list.yml"></a></p><p>We publish various <ahref=https://github.com/linuxserver/docker-mods>Docker Mods</a> to enable additional functionality within the containers. The list of Mods available for this image (if any) as well as universal mods that can be applied to any one of our images can be accessed via the dynamic badges above.</p><h2id=support-info>Support Info<aclass=headerlinkhref=#support-infotitle="Permanent link">¶</a></h2><ul><li>Shell access whilst the container is running:</li><li><code>docker exec -it code-server /bin/bash</code></li><li>To monitor the logs of the container in realtime:</li><li><code>docker logs -f code-server</code></li><li>Container version number</li><li><code>docker inspect -f '{{ index .Config.Labels "build_version" }}' code-server</code></li><li>Image version number</li><li><code>docker inspect -f '{{ index .Config.Labels "build_version" }}' lscr.io/linuxserver/code-server:latest</code></li></ul><h2id=versions>Versions<aclass=headerlinkhref=#versionstitle="Permanent link">¶</a></h2><ul><li><strong>01.07.23:</strong> - Deprecate armhf. As announced <ahref=https://www.linuxserver.io/blog/a-farewell-to-arm-hf>here</a></li><li><strong>05.10.22:</strong> - Install recommended deps to maintain parity with the older images.</li><li><strong>29.09.22:</strong> - Rebase to jammy, switch to s6v3. Fix chown logic to skip <code>/config/workspace</code> contents.</li><li><strong>20.02.22:</strong> - Install using the official tarballs.</li><li><strong>29.12.21:</strong> - Add <code>install-extension</code> as a helper for mods to install extensions.</li><li><strong>06.12.21:</strong> - Add <code>DEFAULT_WORKSPACE</code> env var.</li><li><strong>29.11.21:</strong> - Rebase to Ubuntu focal.</li><li><strong>16.09.21:</strong> - Fix slow <code>chown</code> on large workspace (contents of workspace folder no longer chowned).</li><li><strong>11.07.21:</strong> - Bump node to 14 to fix builds</li><li><strong>08.05.21:</strong> - Fix doc link</li><li><strong>04.02.20:</strong> - Allow setting gui password via hash using env var <code>HASHED_PASSWORD</code>.</li><li><strong>23.12.20:</strong> - Allow setting sudo password via hash using env var <code>SUDO_PASSWORD_HASH</code>.</li><li><strong>29.05.20:</strong> - Add --domain-proxy support.</li><li><strong>21.05.20:</strong> - Shrink images, install via yarn, fix arm32v7 build.</li><li><strong>18.05.20:</strong> - Switch to multi-arch images, install via npm.</li><li><strong>29.04.20:</strong> - Update start arguments.</li><li><strong>01.04.20:</strong> - Structural changes required for v3.</li><li><strong>17.01.20:</strong> - Fix artifact url retrieval from github.</li><li><strong>24.10.19:</strong> - Upgrade to v2 builds.</li><li><strong>28.09.19:</strong> - Update project logo.</li><li><strong>21.09.19:</strong> - Add development builds/tag.</li><li><strong>09.07.19:</strong> - Add optional sudo access.</li><li><strong>01.07.19:</strong> - Add nano.</li><li><strong>24.06.19:</strong> - Initial Release.</li></ul><hr><divclass=md-source-file><small> Last update: <spanclass="git