I have installed Code Server according to this instruction. All goes well except the terminal is running as root.
Digging up for information and turns out an additional line in the systemctl service configuration file /lib/systemd/system/code-server.service
would do.
[service]
user=USERNAMEGOESHERE