Same as installing code-server on Arch, except you need an OpenRC script.

Install using yay

yay is a convenient AUR helper.

1
yay -S code-server 

Install using makepkg

1
2
3
git clone https://aur.archlinux.org/code-server.git
cd code-server
makepkg -si 

Download and configure OpenRC script

The script is pretty generic and should work on most OpenRC-based distributions with minimal tweaks. You just need to download it, make it executable and put your username in line 3.

1
2
3
cd /etc/init.d/
sudo wget -c https://gitea.adityakumar.xyz/aditya/code-server-openrc/raw/branch/master/code-server 
sudo chmod +x code-server 

code-server reads configuration from ~/.config/code-server/config.yaml. It is better than sending arguments directly to code-server using the script.

Usage

Start on boot with default runlevel

1
sudo rc-update add code-server default 

Start the service immediately

1
sudo rc-service code-server start