This tutorial will guide you through the installation process of code-server on Ubuntu Server Latest.
Before starting the installation process, make sure you have the following prerequisites:
To avoid potential conflicts, we need to update the system before installing any new software.
Start by logging in to your Ubuntu Server Latest machine and executing the following command in a terminal or via SSH:
sudo apt-get update
sudo apt-get upgrade
This will update the package lists and upgrade any outdated software on your machine.
code-server requires Node.js to run. To install it, execute the following command:
sudo apt-get install nodejs
Once the installation is complete, verify the installation by checking the installed version:
node -v
If the command returns the version number of Node.js, you are good to go.
To install code-server, you can use the prebuilt binaries or compile the source code yourself. For this tutorial, we will be using the prebuilt binaries.
Execute the following command to download the latest version of code-server:
curl -fsSL https://code-server.dev/install.sh | sh
This will download and execute the installation script. Wait for the installation to complete. Once it's done, you should see a message that looks like this:
To have code-server start at boot, run:
sudo systemctl enable --now code-server@$USER
Installation complete!
This message confirms that code-server is now installed on your machine.
By default, code-server runs on port 8080. You can change this by creating a configuration file at ~/.config/code-server/config.yaml
.
To make code-server available on port 80, add the following line to the configuration file:
bind-addr: 0.0.0.0:80
Note that running code-server on port 80 requires root privileges. You can either start code-server as root or use a reverse proxy like NGINX to proxy requests to port 80.
For more information on configuring code-server, refer to the official documentation.
To start code-server, execute the following command:
code-server
This will start code-server and display a URL that you can use to access the web interface.
Congratulations! You have successfully installed and configured code-server on your Ubuntu Server Latest machine. You can now use code-server to write and edit code from anywhere with a web browser.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!