Tuesday 14 January 2020

- Install & run "Visual Studio Code Server" in Ubuntu

1. run this command
wget https://github.com/cdr/code-server/releases/download/2.1688-vsc1.39.2/code-server2.1688-vsc1.39.2-linux-x86_64.tar.gz
tar xvfz code-server2.1688-vsc1.39.2-linux-x86_64.tar.gz
sudo mv code-server2.1688-vsc1.39.2-linux-x86_64/code-server /usr/local/bin
mkdir ~/project
sudo curl https://gist.githubusercontent.com/subicura/d025000486d30d92dfa6ccc523c3f5e3/raw/2e93bb0dca992523a3e3a6fdba95d2f3526c52db/codeserver.service -o /lib/systemd/system/codeserver.service
sudo systemctl start codeserver
sudo systemctl enable codeserver

2. check your port
ubuntu@ip-172-26-0-243:~$ sudo systemctl status codeserver
● codeserver.service - Code Server IDE
   Loaded: loaded (/lib/systemd/system/codeserver.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2020-01-15 01:51:52 UTC; 1min 56s ago
 Main PID: 4755 (code-server)
    Tasks: 23 (limit: 4704)
   CGroup: /system.slice/codeserver.service
           ├─4755 /usr/local/bin/code-server --port 8000 /home/ubuntu/project
           └─4777 /usr/local/bin/code-server --port 8000 /home/ubuntu/project

> 8080 is the port or VS Code Server

3. Access server http:/111.111.111.111:8080
4. move directory and get password

ubuntu@ip-172-26-0-243:~$ cd project

ubuntu@ip-172-26-0-243:~$ PASSWORD=1q2w3e4r nohup code-server -p 8000 --allow-http &

ubuntu@ip-172-26-0-243:~$ nohup: ignoring input and appending output to 'nohup.out'

5. access  server http:/111.111.111.111:8080 - Password - 1q2w3e4r (login)
 
==========  ReStart ===================================

* Restart Visual Studio Code Server
ubuntu@ip-172-26-0-243:~$ rm -r project

ubuntu@ip-172-26-0-243:~$ cd project

ubuntu@ip-172-26-0-243:~$ PASSWORD=1q2w3e4r nohup code-server -p 8000 --allow-http &

access  server http:/111.111.111.111:8080 - Password - 1q2w3e4r (login)


No comments: