How to Install code-server on Manjaro

Introduction

Code-server is a popular open-source project that allows you to run a web-based version of Visual Studio Code. It is a perfect solution for developers who prefer to work in a web-based environment. In this tutorial, we will walk you through the steps to install code-server on Manjaro.

Prerequisites

Before you begin, make sure that your Manjaro system is up-to-date. You can do this by running the following command in the Terminal:

sudo pacman -Syu

Step 1: Install Required Dependencies

The first step is to install the required dependencies for code-server. You can do this by running the following command in the Terminal:

sudo pacman -S nodejs npm

Step 2: Install code-server

Next, you need to download and install code-server from the GitHub repository. You can do this by running the following commands in the Terminal:

mkdir ~/code-server
cd ~/code-server
wget https://github.com/coder/code-server/releases/download/v3.9.0/code-server-3.9.0-linux-amd64.tar.gz
tar -xzvf code-server-3.9.0-linux-amd64.tar.gz

Step 3: Create a Systemd Service

To run code-server as a daemon, you need to create a systemd service. You can do this by creating a new file called code-server.service in the /etc/systemd/system directory:

sudo nano /etc/systemd/system/code-server.service

Then, paste the following lines into the file:

[Unit]
Description=code-server
After=network.target

[Service]
Type=simple
User=%i
ExecStart=/home/%i/code-server/code-server
Restart=always

[Install]
WantedBy=multi-user.target

Save and close the file.

Step 4: Enable and Start the Service

After creating the systemd service, you need to enable and start it. You can do this by running the following commands in the Terminal:

sudo systemctl enable --now code-server.service
sudo systemctl status code-server.service

You should see the status of the service as active.

Step 5: Open code-server

Finally, you can open your web browser and enter the following URL to access code-server:

http://localhost:8080

Log in with your user account credentials, and you should be able to use your favorite editor in your web browser.

Conclusion

In this tutorial, you learned how to install code-server on Manjaro. As you can see, the process is straightforward and easy to follow. Enjoy using code-server for your web development projects!

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!