Openvscode

From Wiki
Jump to navigation Jump to search

Overview

Deploy a full-featured web-based IDE with local AI coder (Llama 3 via Ollama), automation via n8n, secure HTTPS with Nginx & Certbot, and robust system security on a dedicated Ubuntu 24.04 LTS VPS/server. The final product delivers browser access at https://ide.illuni.in with AI chat, code generation, and workflow automation tools.<ref name="1"/><ref name="2"/><ref name="4"/><ref name="6"/>

Requirements

OS

Ubuntu 24.04 LTS (64-bit)

Hardware

Minimum 8 vCPUs, 12 GB RAM, 100 GB SSD

Network

Incoming ports 22 (SSH), 80/443 (HTTP/HTTPS)

Domain

A-record for ide.illuni.in pointed to server IP

Security

SSH key auth only, UFW firewall, Fail2Ban, unattended-upgrades enabled<ref name="4"/>

System Preparation

Update System and Install Essentials

 apt update && apt -y upgrade apt -y install software-properties-common git unzip curl wget tar ufw fail2ban ca-certificates 

Harden Security

Configure firewall:

 ufw allow 22 ufw allow 80 ufw allow 443 ufw enable 

Set up Fail2Ban and enable automatic upgrades:

 systemctl enable --now fail2ban apt install unattended-upgrades dpkg-reconfigure unattended-upgrades 

Use SSH key authentication—disable password login in /etc/ssh/sshd_config (PasswordAuthentication no).<ref name="4"/>

OpenVSCode Server Installation

Create Directory & Download

cd /opt
sudo mkdir openvscode-server
cd openvscode-server
curl -L https://github.com/gitpod-io/openvscode-server/releases/download/openvscode-server-v1.103.1/openvscode-server-v1.103.1-linux-x64.tar.gz -o openvscode-server.tar.gz
tar -xzf openvscode-server.tar.gz --strip-components=1
rm openvscode-server.tar.gz

Create Service User

 useradd -m -s /bin/bash vscode 
chown -R vscode:vscode /opt/openvscode-server
 

Setup systemd Service

Create /etc/systemd/system/openvscode.service:

 
[Unit]
Description=OpenVSCode Server
After=network.target

[Service]
Type=simple
User=vscode
WorkingDirectory=/opt/openvscode-server
ExecStart=/opt/openvscode-server/bin/openvscode-server --host 0.0.0.0 --port 3100 --without-connection-token
Restart=always
RestartSec=3

[Install]
WantedBy=multi-user.target

Load and start the service:

 sudo systemctl daemon-reload 
sudo systemctl enable --now openvscode 
sudo systemctl status openvscode 
ss -tulpn | grep 3100 

Ollama Installation (Local AI Models)

Install Ollama

 curl -fsSL https://ollama.com/install.sh | sh 

Confirm install:

 ollama --version 

Pull AI Models

 
/usr/local/bin/ollama pull llama3 
/usr/local/bin/ollama pull codellama:7b 
/usr/local/bin/ollama pull mistral:latest 
/usr/local/bin/ollama list 

Configure Ollama as a Service (open to network)

Edit /etc/systemd/system/ollama.service:

 [Unit] Description=Ollama AI Service After=network.target [Service] Type=simple User=root ExecStart=/usr/local/bin/ollama --host 0.0.0.0 --port 11434 serve Restart=always RestartSec=5 [Install] WantedBy=multi-user.target 

Reload and start service:

 sudo systemctl daemon-reload sudo systemctl enable --now ollama sudo systemctl status ollama ss -tulpn | grep 11434 

Nginx Reverse Proxy with HTTPS (Certbot)

Install Nginx

 sudo apt install nginx -y sudo systemctl enable --now nginx sudo systemctl status nginx 

Configure Reverse Proxy

Create /etc/nginx/sites-available/openvscode.conf:

 server { listen 80; server_name ide.illuni.in; location / { proxy_pass http://127.0.0.1:3100; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } 

Enable config:

 ln -sf /etc/nginx/sites-available/openvscode.conf /etc/nginx/sites-enabled/openvscode.conf sudo nginx -t sudo systemctl reload nginx 

Install Certbot and Issue SSL

 sudo apt install certbot python3-certbot-nginx -y sudo certbot --nginx -d "ide.illuni.in" -m "admin@illuni.in" --agree-tos -n sudo systemctl reload nginx 

Certbot automates SSL certificate provisioning and renewal.<ref name="4"/>

Install n8n (Automation Tool)

Follow official n8n installation guide for Ubuntu. Example for npm:

 npm install -g n8n n8n start 

For production, consider running n8n as a systemd service and configuring a reverse proxy.

Install and Configure Continue Extension

Access OpenVSCode: Visit https://ide.illuni.in/ Install Continue Extension: In the left sidebar, find the Extensions pane, search for "Continue", and click Install.<ref name="5"/><ref name="2"/> Configure Continue for Ollama:

Open a terminal in OpenVSCode as vscode user:

 mkdir -p ~/.continue nano ~/.continue/config.json 

Paste (replace <SERVER_IP>):

 { "models": [ { "title": "Ollama (Llama 3)", "provider": "ollama", "model": "llama3", "api_base": "http://<SERVER_IP>:11434" } ] } 

Confirm connection:

 curl http://<SERVER_IP>:11434/api/tags 

Reload/refresh the Continue extension UI.

Final Verification

   Open https://ide.illuni.in/ in browser.
   Try out code completion, AI chat, and automation workflows.
   Confirm secure HTTPS lock; certificates should auto-renew via Certbot.
   Ensure only SSH key authentication is allowed; periodic security updates run automatically.

Conclusion

This setup delivers a secure, scalable, browser IDE with local AI coding assistant and workflow automation—all on Ubuntu 24.04 LTS. This workflow is suitable for remote development teams, solo devs, and anyone needing advanced code capabilities balanced with maximum data control and security.

References

<references/>