first update your system

sudo apt update && sudo apt upgrade

Update Node

npm install -g n

sudo n stable

run the following command to automate the setup

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