새소식

Operation System/Unix & Linux

Visual Studio Code 웹에서 사용하기 (code-server)

  • -
728x90
반응형

모바일/태블릿을 통해 코드 작성/수정/확인 하고 싶은데 마땅한 앱이 없어 불편한 경우가 있습니다.
이럴 경우 Visual Studio Code를 웹에서 제공하게끔 서버형태로 만들어 사용할 수 있습니다.


code-server
  • 2022년 09월 24일 기준으로도 현재 활발하게 개발되고 있습니다.

 

GitHub - coder/code-server: VS Code in the browser

VS Code in the browser. Contribute to coder/code-server development by creating an account on GitHub.

github.com

 

code-server 설치 준비

  • code-server github 레파지토리에서 Releases에서 최신 버전으로 이동합니다.
  • 설치하고자 하는 유형의 파일의 링크 주소 복사를 합니다.
  • wget 유틸리티로 파일을 다운 받습니다.
    • 직접 파일을 다운로드하고 SFTP로 업로드 시켜도 됩니다.
 
# wget https://github.com/coder/code-server/releases/download/v4.4.0/code-server-4.4.0-linux-amd64.tar.gz
code-server 설치
  • 압축해제
# tar -xvzf code-server-4.4.0-linux-amd64.tar.gz
  • 메타 파일 생성
# mkdir -p  $HOME/.config/code-server
# vi $HOME/.config/code-server/config.yaml 
bind-addr: 0.0.0.0:40000 <--사용할 포트 지정
auth: password  <-- 인증 방식 지정
password: qwert1234! <--사용할 암호 지정
cert: false

 

code-server 실행
  • code-server 수행 및 지정한 서비스 포트로 접속 테스트
# ./code-server 
***** Please use the script in bin/code-server instead!
***** This script will soon be removed!
***** See the release notes at https://github.com/coder/code-server/releases/tag/v3.4.0
[2022-05-25T09:19:58.976Z] info  code-server 4.4.0 b088ec7adf9e17bc75215f79e21498eb40da03ed
[2022-05-25T09:19:58.977Z] info  Using user-data-dir ~/.local/share/code-server
[2022-05-25T09:19:58.989Z] info  Using config file ~/.config/code-server/config.yaml
[2022-05-25T09:19:58.989Z] info  HTTP server listening on http://0.0.0.0:40000/ 
[2022-05-25T09:19:58.989Z] info    - Authentication is enabled
[2022-05-25T09:19:58.989Z] info      - Using password from ~/.config/code-server/config.yaml
[2022-05-25T09:19:58.989Z] info    - Not serving HTTPS 
[09:20:02] Extension host agent started.

  • 로그 확인
# ./code-server 
***** Please use the script in bin/code-server instead!
***** This script will soon be removed!
***** See the release notes at https://github.com/coder/code-server/releases/tag/v3.4.0
[2022-05-25T09:19:58.976Z] info  code-server 4.4.0 b088ec7adf9e17bc75215f79e21498eb40da03ed
[2022-05-25T09:19:58.977Z] info  Using user-data-dir ~/.local/share/code-server
[2022-05-25T09:19:58.989Z] info  Using config file ~/.config/code-server/config.yaml
[2022-05-25T09:19:58.989Z] info  HTTP server listening on http://0.0.0.0:40000/ 
[2022-05-25T09:19:58.989Z] info    - Authentication is enabled
[2022-05-25T09:19:58.989Z] info      - Using password from ~/.config/code-server/config.yaml
[2022-05-25T09:19:58.989Z] info    - Not serving HTTPS 
[09:20:02] Extension host agent started.
[09:20:03] [180.64.215.16][cfe5d45f][ManagementConnection] New connection established.
[09:20:04] [180.64.215.16][92124727][ExtensionHostConnection] New connection established.
[09:20:04] [180.64.215.16][92124727][ExtensionHostConnection] <314> Launched Extension Host Process.
  • 터미널이 종료되도 서비스 되도록 백그라운드로 실행
# nohup ./code-server &
[1] 327

# tail -f nohup.out
[09:20:58] [180.64.215.16][b8f60394][ManagementConnection] The client has disconnected gracefully, so the connection will be disposed.
[09:20:58] [180.64.215.16][acc3ee7f][ExtensionHostConnection] <401> Extension Host Process exited with code: 0, signal: null.

 

728x90
반응형

'Operation System > Unix & Linux' 카테고리의 다른 글

ssh: command not found  (0) 2022.09.25
ifconfig: command not found  (0) 2022.09.25
netstat: command not found  (0) 2022.09.25
sshd: command not found  (0) 2022.09.25
telnet 설치  (0) 2022.09.25

포스팅 주소를 복사했습니다

이 글이 도움이 되었다면 공감 부탁드립니다.