Skip to content

listen on both ipv4 and ipv6 even when running container as root#216

Merged
thespad merged 1 commit into
linuxserver:masterfrom
ozraru:ipv6
Jul 3, 2026
Merged

listen on both ipv4 and ipv6 even when running container as root#216
thespad merged 1 commit into
linuxserver:masterfrom
ozraru:ipv6

Conversation

@ozraru

@ozraru ozraru commented May 17, 2026

Copy link
Copy Markdown
Contributor

linuxserver.io


  • I have read the contributing guideline and understand that I have made the correct modifications

Description:

Updated /root/etc/s6-overlay/s6-rc.d/svc-code-server/run to change --bind-addr from 0.0.0.0:8443 to [::]:8443 when the container is executed as the root user.
Also added the corresponding changelog entry in readme-vars.yml (and README.md).

Benefits of this PR and context:

In a #179, the container was configured to listen on both IPv4 and IPv6. However, that change seems to have been missed or not fully applied for the root execution path. This PR corrects it so that code-server properly binds to [::]:8443 regardless of whether it's running as root or a non-root user.

How Has This Been Tested?

  • OS: Arch Linux (Kernel 7.0.8-zen1-1-zen)
  • Docker: 29.5.0
  • Docker Compose: 5.1.3

Test A: dual stack

compose.yaml

services:
  vscode:
    image: linuxserver/code-server:latest
    environment:
      - PUID=1000
      - PGID=1000
      - PASSWORD=[redacted]
      - SUDO_PASSWORD=[redacted]
    volumes:
      - ./data:/config/workspace
      - ./code-config:/config
    ports:
      - "8443:8443"
    restart: unless-stopped

networks:
  default:
    enable_ipv6: true
  • before: Accessing localhost:8443 resulted in a CONNECTION_RESET error.
  • after: Accessing localhost:8443 connects successfully.

Test B: IPv4 only

compose.yaml

services:
  vscode:
    image: linuxserver/code-server:latest
    environment:
      - PUID=1000
      - PGID=1000
      - PASSWORD=[redacted]
      - SUDO_PASSWORD=[redacted]
    volumes:
      - ./data:/config/workspace
      - ./code-config:/config
    ports:
      - "8443:8443"
    restart: unless-stopped
  • before and after: Accessing localhost:8443 connects successfully.

Source / References:

#179

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for opening this pull request! Be sure to follow the pull request template!

@LinuxServer-CI

Copy link
Copy Markdown
Collaborator

This pull request has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

@ozraru

ozraru commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

@aptalca (author of #179)
@thespad (reviewer of #179)

Hello, sorry to bother you - this is actually my first contribution to a linuxserver repo, so I'm not fully sure of the usual process here.

This PR follows the same reasoning as #179 - it just extends the same fix to the root-run case, which was missed originally. Could one of you take a look when you have a moment?

Thanks!

@github-project-automation github-project-automation Bot moved this from PRs to PRs Approved in Issue & PR Tracker Jul 3, 2026
@thespad thespad merged commit 84a119f into linuxserver:master Jul 3, 2026
5 checks passed
@LinuxServer-CI LinuxServer-CI moved this from PRs Approved to Done in Issue & PR Tracker Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants