Skip to content

Setup Code-Server

Overview

Run VS Code on any machine anywhere and access it in the browser.

Important Docker Files

.env file

.env
NAME=code-server
APPDATA=
ID=1000
TZ=America/New_York
SUB=code
DOMAIN=
FILES=/opt/projects/docker

docker-compose.yml file

docker-compose.yml
services:
  code-server:
    image: lscr.io/linuxserver/code-server
    container_name: ${NAME}
    restart: always
    networks:
      - proxy
    environment:
      PUID: ${ID}
      PGID: ${ID}
      TZ: ${TZ}
      PROXY_DOMAIN: ${SUB}.${DOMAIN}
      DEFAULT_WORKSPACE: /files
    volumes:
      - ${APPDATA}/${NAME}/config:/config
      - ${FILES}:/files
    labels:
      swag: enable
      swag_address: ${NAME}
      swag_port: 8443
      swag_proto: http
      swag_url: ${SUB}.${DOMAIN}
      swag_auth: authelia
      com.centurylinklabs.watchtower.enable: true
networks:
  proxy:
    external: true

Start the Container

Start the Container
docker compose up -d