Learn to Code via Tutorials on Repl.it!

← Back to all posts
Running vs code server (and possibly GitHub CoPilot) on Replit!
h
rohanpatra (2)

So I recently got into the GitHub Copilot beta and I was really excited, but I later found out that the beta only works with VS Code. I really like using Replit because of the fact that everything is stored online and I do not need to worry about repos etc. to code on different devices. Through a bit of research, I found out you can pretty easily run vs code server on replit which is pretty useful in itself because vscode is a pretty powerful tool/IDE (when configured properly). However, the Copilot extension does not show up in the extensions marketplace on the vscode server, so I am waiting on a response in the Copilot discussions board on whether or not there is another way to install it as all vs code extensions are supposed to be supported by vs code server.

Anyways, if anyone else wants to get vs code running on a repl, here's all you have to do:

VS Code Server Installation Steps for Replit

  1. Create a Bash Repl
  2. Edit the main.sh script with the following code:
    if  [[  !  -d code-server-3.10.2-linux-amd64  ]]
    
    then
    
    wget https://github.com/cdr/code-server/releases/download/v3.10.2/code-server-3.10.2-linux-amd64.tar.gz
    
    tar xvzf code-server-3.10.2-linux-amd64.tar.gz
    
    fi
    
      
    
    cd code-server-3.10.2-linux-amd64/bin
    
      
    
    # ./code-server --install-extension extension.id
    
      
    
    ./code-server  --bind-addr  0.0.0.0:8080  --auth password
    
    {"mode":"full","isActive":false}
  3. If you are using the free version of Repl, you are going to have to modify the commented out line to add your extensions on each run of the script as they won't persist after Replit resets your instance. If you have always on enabled, you don't have to worry about that.
  4. Add a password for your instance by creating an evironmental variable named PASSWORD with the value of the password you want.
  5. Then, just run the script, and after everything is downloaded and installed, you should see the Replit webview window pop open with an instance of vscode. You can use the URL to open vscode in a separate window

That's It!

Quick Note: When creating files through vscode, always create them in the runner/<name of your Repl> directory which is the Repl's home directory in the container.

Comments
hotnewtop
RoBlockHead (531)

I’m the maintainer of Replit for VSCode, it’s not the best for this application, but it works similar to code server. In this application, I bet it probably is worse though. You can get it here