Skip to main content

Install Code-Server on Linux Mint

·264 words·2 mins
Thorsten Lenzen
Author
Thorsten Lenzen
Coding, Devops and Homelab maniac…

In this post, you will learn how to install Code-Server on Linux Mint and configure it for network access.

1. Installation of code-server
#

The easiest way to install it is via the official installation script. Open your terminal and run:

curl -fsSL https://code-server.dev/install.sh | sh

2. Opening Network Access
#

By default, code-server is configured to only respond to localhost (meaning only on the machine itself). To allow others to access it, we need to adjust the configuration.

First, start the service briefly to generate the configuration file:

code-server

(Press Ctrl + C immediately once the first few lines of text appear).

Now, open the configuration file:

nano ~/.config/code-server/config.yaml

Change the line bind-addr: 127.0.0.1:8080 to: bind-addr: 0.0.0.0:8080

This allows connections from any IP address within your local network.

Setting a password: In the same file, you will find the password: field. Change it to a secure password that you want your users to use.

Save with Ctrl + O, press Enter, and exit with Ctrl + X.

3. Adjusting the Firewall on Linux Mint
#

To allow colleagues or other devices to connect, you must open port 8080:

sudo ufw allow 8080

4. code-server as a Background Service (Autostart)
#

To ensure the server stays running even when you are not logged in, we enable it as a system service:

sudo systemctl enable --now code-server@$USER

Note: The --now flag ensures the service starts immediately without requiring a reboot.


Accessing the Server
#

To access the editor from another computer, open a browser and enter your local IP address followed by the port: http://<your-ip-address>:8080