Skip to content

Deploying a self-hosted Continue.dev backend for an internal team on Ubuntu 22.04

Stand up a hardened backend for the Continue.dev VS Code / JetBrains assistant — internal LLM routing via LiteLLM, indexable docs server, telemetry off, nginx + Let's Encrypt, behind your VPN.

The dev team has adopted Continue.dev because someone shared a TikTok and the autocomplete is convincing. Three weeks in, you find that the eight people using it are each pointing at their personal OpenAI key, two of them have committed those keys, the indexing config in their ~/.continue/config.json has been duplicated by everyone via copy-paste, the “documentation” the assistant draws from is whatever each developer happened to bookmark, and the JetBrains user keeps asking why his suggestions look different from the VS Code users’. The team wants one config, one source of LLM routing, one set of indexed internal docs, and the audit-friendly property of no developer having a direct provider API key on their laptop.

What’s happening

Continue.dev’s open-source IDE extensions (VS Code, JetBrains, Vim) read a JSON config that points at one or more “models” by base_url + api_key. There is no proprietary “Continue cloud backend” needed — the backend is whatever OpenAI-compatible endpoint you point it at. Centralizing the setup means: (1) a shared config.yaml or config.json template in your dotfiles repo that points every IDE at the same internal endpoint, (2) that endpoint is your LiteLLM proxy (or any OpenAI-compatible proxy) on the internal network behind nginx + auth, (3) the “indexed docs” feature — which lets the assistant retrieve from internal documentation — points at a small static-file server you control so the docs index is consistent across the team, and (4) telemetry is off. The endpoint must be reachable from each developer’s laptop; this normally means it lives on the VPN, not the public internet. The shared docs server is just nginx serving a directory of markdown / HTML / text files; Continue’s docs indexer reads them on demand. Per-developer virtual keys are issued by your LiteLLM proxy — every developer gets their own key with their own budget, and revoking a leaving employee is one click rather than rotating a shared key for the team.

How to verify

After install, the host should expose only :443 to the VPN and :22 to ops:

ss -lntp | grep -E ':(80|443|8082)\b'
# 0.0.0.0:443  nginx
# 127.0.0.1:8082 docs-server

From a developer laptop on the VPN, the docs server should serve a known file:

curl -sS https://continue.example.com/docs/internal-architecture.md | head

From the same laptop, an LLM call routed at the team’s LiteLLM proxy should succeed with the developer’s virtual key:

curl -sS -H "Authorization: Bearer sk-dev-jane-xxx" \
  https://llm.example.com/v1/models | jq '.data[].id'

If the docs endpoint is reachable from outside the VPN (curl from a non-VPN connection succeeds), the access control is wrong. The intent is: docs + LLM live on the internal network; external traffic gets nothing.

Inside the IDE, the assistant should fail closed when the LiteLLM key has been revoked — not silently fall back to OpenAI default credentials:

Continue → Settings → Models → "Internal Claude Sonnet" → Test connection
401: invalid key

The fix

Save the script below as /root/setup-continue-dev-ubuntu22.sh, then run it. It installs a minimal Continue.dev backend host on a fresh Ubuntu 22.04 VM: base update, UFW (SSH + HTTP + HTTPS only, with HTTP / HTTPS optionally restricted to your VPN CIDR), SSH hardening, Docker CE + compose plugin, nginx serving an indexable static docs directory and reverse-proxying nothing else (this host’s only role is docs + the dotfile template; LLM routing lives on the LiteLLM host), Let’s Encrypt via the certbot nginx plugin, and a shared config.yaml written to /srv/continue/config.yaml.template that developers’ IDEs reference.

#!/usr/bin/env bash
set -euo pipefail

### Ubuntu 22.04 Continue.dev backend host clean VM installer
### Serves shared docs corpus + shared IDE config template
### LLM routing assumed to live on a separate LiteLLM host
### Keeps root SSH key login enabled, disables SSH password login
### Reboot remains manual

if [[ "$(id -u)" -ne 0 ]]; then
  echo "Run as root."
  exit 1
fi

: "${CONTINUE_DOMAIN:?Set CONTINUE_DOMAIN=continue.example.com}"
: "${CONTINUE_EMAIL:?Set CONTINUE_EMAIL=ops@example.com for Let's Encrypt}"
: "${CONTINUE_VPN_CIDR:?Set CONTINUE_VPN_CIDR=10.0.0.0/8 to lock public exposure}"
: "${LITELLM_PROXY_URL:?Set LITELLM_PROXY_URL=https://llm.example.com to embed in the IDE config}"

echo
echo "========================================"
echo "Continue.dev Backend Ubuntu 22.04 Setup"
echo "========================================"
echo

echo "==> Updating base OS"
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get -y upgrade

echo "==> Installing base packages"
apt-get -y install \
  vim curl wget ca-certificates gnupg2 \
  chrony fail2ban unattended-upgrades \
  ufw lsof tcpdump dnsutils tar gzip \
  iproute2 net-tools openssl jq \
  software-properties-common git rsync

echo "==> Enabling time sync"
systemctl enable --now chrony
timedatectl set-ntp true

echo "==> Applying kernel/network tuning"
cat > /etc/sysctl.d/99-continue.conf <<'SYSCTL'
net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr
net.core.somaxconn = 4096
net.ipv4.tcp_syncookies = 1
kernel.dmesg_restrict = 1
kernel.kptr_restrict = 2
fs.file-max = 2097152
SYSCTL
modprobe tcp_bbr || true
echo tcp_bbr > /etc/modules-load.d/bbr.conf
sysctl --system

cat > /etc/security/limits.d/99-continue.conf <<'LIMITS'
* soft nofile 64000
* hard nofile 64000
LIMITS

echo "==> Configuring UFW (VPN-only HTTP/HTTPS)"
ufw --force reset
ufw default deny incoming
ufw default allow outgoing
ufw allow 22/tcp
ufw allow from "${CONTINUE_VPN_CIDR}" to any port 80 proto tcp
ufw allow from "${CONTINUE_VPN_CIDR}" to any port 443 proto tcp
# Let's Encrypt HTTP-01 needs ephemeral inbound on 80 during issuance;
# add a temporary public rule, then remove after certbot succeeds.
ufw allow 80/tcp comment 'temp lets encrypt http01'
ufw --force enable

echo "==> Hardening SSH"
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak.$(date +%F-%H%M%S)

set_sshd_option() {
  local key="$1"
  local value="$2"
  if grep -qE "^[#[:space:]]*${key}[[:space:]]+" /etc/ssh/sshd_config; then
    sed -i "s|^[#[:space:]]*${key}[[:space:]].*|${key} ${value}|" /etc/ssh/sshd_config
  else
    echo "${key} ${value}" >> /etc/ssh/sshd_config
  fi
}

set_sshd_option PermitRootLogin prohibit-password
set_sshd_option PasswordAuthentication no
set_sshd_option PubkeyAuthentication yes
set_sshd_option X11Forwarding no
set_sshd_option ClientAliveInterval 300
set_sshd_option ClientAliveCountMax 2

sshd -t
systemctl restart ssh

mkdir -p /etc/fail2ban/jail.d
cat > /etc/fail2ban/jail.d/sshd.local <<'FAIL2BAN'
[sshd]
enabled = true
port = ssh
backend = systemd
maxretry = 4
bantime = 1h
FAIL2BAN
systemctl enable --now fail2ban

cat > /etc/apt/apt.conf.d/20auto-upgrades <<'AUTOUPG'
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
AUTOUPG

echo "==> Preparing /srv/continue layout"
mkdir -p /srv/continue/docs /srv/continue/templates
chmod 755 /srv/continue /srv/continue/docs /srv/continue/templates

# Shared docs corpus seed. Replace these with your own docs (or `git clone` into /srv/continue/docs/<repo>).
cat > /srv/continue/docs/README.md <<'DOC'
# Internal docs corpus

This directory is served as a flat docs corpus for Continue.dev's @docs indexer.
Add files by category:

- architecture/   internal architecture diagrams + decision records
- runbooks/       operational runbooks (one md per scenario)
- conventions/    coding conventions, lint rules, naming
- onboarding/     new-engineer onboarding doc set

The IDE config below references this URL.
DOC

# IDE config template -- developers copy this to ~/.continue/config.yaml
cat > /srv/continue/templates/config.yaml <<EOF
# Internal Continue.dev config -- generated by infra
# DO NOT add personal API keys; this file points at the team proxy.

name: company-internal
version: 1.0.0

models:
  - name: Internal Claude Sonnet
    provider: openai
    model: claude-sonnet-4
    apiBase: ${LITELLM_PROXY_URL}/v1
    apiKey: \${env:LITELLM_VIRTUAL_KEY}
    roles:
      - chat
      - edit
      - apply

  - name: Internal Claude Haiku (autocomplete)
    provider: openai
    model: claude-haiku
    apiBase: ${LITELLM_PROXY_URL}/v1
    apiKey: \${env:LITELLM_VIRTUAL_KEY}
    roles:
      - autocomplete

  - name: Internal Embeddings (TEI)
    provider: openai
    model: BAAI/bge-large-en-v1.5
    apiBase: ${LITELLM_PROXY_URL}/v1
    apiKey: \${env:LITELLM_VIRTUAL_KEY}
    roles:
      - embed

context:
  - provider: code
  - provider: docs
  - provider: diff
  - provider: terminal
  - provider: problems
  - provider: codebase
  - provider: folder

docs:
  - name: internal
    startUrl: https://${CONTINUE_DOMAIN}/docs/
    faviconUrl: https://${CONTINUE_DOMAIN}/favicon.ico

# Telemetry off -- this is a non-negotiable for internal use
allowAnonymousTelemetry: false
EOF

chmod 644 /srv/continue/templates/config.yaml

echo "==> Installing nginx and certbot"
apt-get -y install nginx certbot python3-certbot-nginx

cat > /etc/nginx/sites-available/continue <<NGINX
server {
    listen 80;
    listen [::]:80;
    server_name ${CONTINUE_DOMAIN};
    location /.well-known/acme-challenge/ { root /var/www/html; }
    location / { return 301 https://\$host\$request_uri; }
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name ${CONTINUE_DOMAIN};

    root /srv/continue;
    index README.md;

    autoindex on;
    autoindex_format html;
    charset utf-8;

    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
    add_header X-Content-Type-Options nosniff always;
    add_header X-Frame-Options DENY always;
    add_header Referrer-Policy strict-origin-when-cross-origin always;

    types {
        text/markdown md;
        text/yaml yaml yml;
        text/plain txt;
    }

    # Docs corpus -- indexable by Continue
    location /docs/ {
        alias /srv/continue/docs/;
        autoindex on;
    }

    # IDE config template -- developers fetch this with curl
    location /templates/ {
        alias /srv/continue/templates/;
        autoindex on;
    }

    # Everything else returns 404
    location / {
        return 404;
    }
}
NGINX

ln -sf /etc/nginx/sites-available/continue /etc/nginx/sites-enabled/continue
rm -f /etc/nginx/sites-enabled/default
nginx -t
systemctl enable --now nginx
systemctl reload nginx

echo "==> Requesting Let's Encrypt certificate"
mkdir -p /var/www/html
certbot --nginx --non-interactive --agree-tos \
  -m "${CONTINUE_EMAIL}" -d "${CONTINUE_DOMAIN}" --redirect

systemctl enable --now certbot.timer

# Tighten port 80 back to VPN once issuance succeeded
ufw delete allow 80/tcp 2>/dev/null || true
ufw allow from "${CONTINUE_VPN_CIDR}" to any port 80 proto tcp

echo "==> Final package update"
apt-get -y upgrade

echo
echo "========================================"
echo "DONE"
echo "========================================"
echo
echo "Listeners:"
ss -lntp | grep -E ':(80|443)\b' || true

echo
echo "Docs URL:      https://${CONTINUE_DOMAIN}/docs/"
echo "IDE template:  https://${CONTINUE_DOMAIN}/templates/config.yaml"

echo
echo "Developer rollout (per-developer one-time):"
echo "  1. Get a virtual key from the LiteLLM admin UI (under Team -> Code Assistants -> Keys)."
echo "  2. export LITELLM_VIRTUAL_KEY=sk-... in your shell rc"
echo "  3. mkdir -p ~/.continue && curl -fsSL https://${CONTINUE_DOMAIN}/templates/config.yaml > ~/.continue/config.yaml"
echo "  4. Reload Continue.dev. Test Connection should succeed against every model."
echo
echo "When a developer leaves: revoke their virtual key in LiteLLM. Their IDE fails closed within minutes."
echo
echo "Telemetry is off; do not let anyone turn it back on. If your IDE shows a 'send telemetry' nag,"
echo "it means the template was edited locally. Re-fetch the template."

Make it executable and run it:

chmod 700 /root/setup-continue-dev-ubuntu22.sh
CONTINUE_DOMAIN=continue.example.com \
CONTINUE_EMAIL=ops@example.com \
CONTINUE_VPN_CIDR=10.0.0.0/8 \
LITELLM_PROXY_URL=https://llm.example.com \
/root/setup-continue-dev-ubuntu22.sh

Populate /srv/continue/docs/ with the internal docs you actually want the assistant to retrieve from — architecture decision records, runbooks, naming conventions. Continue’s @docs context provider crawls the URL on demand; treat updates as cache-bustable by version-stamping filenames or running an nginx cache flush. The IDE template at /srv/continue/templates/config.yaml is the single source of truth — when a model name or a base URL changes, every developer pulls the new template on the next rotation. Per-developer virtual keys live on your LiteLLM proxy with their own budgets and revocation; no developer ever holds a direct provider key.

Run this backend on Stack Harbor’s managed cloud compute behind your VPN, with patching and Sev-1 escalation in place: Cloud compute. To wire it into your broader Managed Cloud Ops program with key-rotation playbooks and onboarding/offboarding automation, talk to an engineer.