Application service does not persist after Codespace stop and start
0 reputation · 31 Dec 2025, 14:49 UTC
Goal: Keep a small web application reachable at all times while using GitHub Codespaces for development, so that stopping and later resuming a Codespace does not require manual restart of the service.
Constraints: The /workspaces directory persists source edits, but any in‑memory state and long‑running processes are lost when the container stops; forwarded ports must be re‑established on each start, and it is unclear whether the devcontainer.json can guarantee automatic service restart and stable port forwarding without a noticeable gap.
Questions: Can the devcontainer.json be set to launch the application automatically on every Codespace start? Does port forwarding remain bound to the same address after a stop/start cycle, or must the client reconnect? Is there a supported way to maintain a continuously running process across Codespace stops?