[{"data":1,"prerenderedAt":186},["ShallowReactive",2],{"seo-verification":3,"blog-self-host-contextforge-vps-mcp-gateway-ma-en":6,"promo-bar-likely":185},{"google":4,"bing":5},"EycwPY2XMyTkVzas3n1ygeNJFGAH513qrMjfDljzsMQ","",{"key":7,"data":8},"blog-self-host-contextforge-vps-mcp-gateway-ma-en",{"id":9,"slug":10,"slugs":11,"title":15,"excerpt":16,"readTime":17,"views":18,"isPinned":19,"noindex":19,"publishedAt":20,"updatedAt":21,"category":22,"categories":27,"featuredImage":29,"bgImage":30,"posterImage":31,"relatedSolution":32,"intro":35,"keyPoints":36,"sections":37,"ctaTitle":117,"ctaBody":118,"ctaButton":119,"ctaUrl":120,"relatedPosts":121},577,"self-host-contextforge-vps-mcp-gateway",{"fr":12,"en":10,"ar":13,"es":14},"self-host-contextforge-vps","استضافة-contextforge-على-vps","autoalojar-contextforge-vps-pasarela-mcp","ContextForge on a VPS: an MCP gateway for your AI agents","Install ContextForge on a VPS with Docker Compose: IBM's open-source MCP gateway, REST APIs as MCP tools, API tokens and HTTPS with nginx.",7,0,false,"2026-11-12T00:00:00+00:00","2026-11-12T13:56:19+00:00",{"id":17,"name":23,"slug":24,"color":25,"icon":26},"Self-hosting","self-hosting","bg-indigo-500\u002F10 text-indigo-400","cloud",[28],{"id":17,"name":23,"slug":24,"color":25,"icon":26},null,"\u002Fblog\u002Fcovers\u002Fbg.svg","\u002Fblog\u002Fcovers\u002Fself-host-contextforge-vps-poster.svg",{"categorySlug":33,"appSlug":34},"artificial-intelligence","contextforge","Every AI agent that needs to call your tools asks for its own configuration: one MCP server per service, declared in every client, with its credentials. ContextForge, IBM's open-source MCP gateway, brings all of that together behind a single address. This guide installs it on a VPS with Docker Compose, locks it with API tokens, publishes it over HTTPS behind nginx, turns a REST API into an MCP tool and connects a client to it.",[],[38,42,52,79,82,95,99,102,105,108,111,114],{"type":39,"title":40,"body":41},"h2","What ContextForge does","ContextForge is a gateway for the Model Context Protocol (MCP), the protocol that lets an AI agent discover and call tools. It sits between your clients — coding assistants, agent frameworks, automations — and the tools they use: remote MCP servers, existing REST or gRPC APIs.\n\nThe project is published by IBM under the Apache-2.0 licence. It provides an admin API, a web console, user and token management, and virtual servers: groups of tools, each exposed at its own MCP address. On a VPS, it is the single entry point for your agents.",{"type":43,"title":44,"items":45},"ul","What the gateway brings",[46,47,48,49,50,51],"**One address** — your clients connect to the gateway, not to each tool.","**REST APIs as tools** — a URL, a method and an input schema, with no MCP server to write.","**Virtual servers** — one set of tools per agent, project or client.","**Federation** — remote MCP servers registered and exposed in the same place.","**API tokens** — one per client, with an expiry date, revocable one by one.","**A web console** — tools, servers, tokens and users managed from `\u002Fadmin`.",{"type":53,"title":54,"headers":55,"rows":58},"comparison","Wiring each tool or going through ContextForge",[5,56,57],"One MCP server per tool","ContextForge",[59,63,67,71,75],[60,61,62],"Client configuration","One tool to declare in every client","One address and a token",[64,65,66],"Service credentials","Copied into every client","Kept by the gateway",[68,69,70],"Existing REST API","An MCP server to write","Declared as a tool",[72,73,74],"Removing access","Client by client","Revoke a token",[76,77,78],"Tools an agent sees","All those it was configured with","Those of its virtual server",{"type":39,"title":80,"body":81},"Prerequisites","An Ubuntu 24.04 VPS with **2 GB of RAM and 2 vCPUs** is enough: with two worker processes, the gateway uses about 800 MB of memory. The data fits in an SQLite database of a few megabytes.\n\nYou need Docker with the Compose plugin, nginx and certbot on the host, `jq` to read API responses, and a name (`mcp.example.com` in this guide) pointing to the VPS IP.",{"type":83,"title":84,"steps":85},"steps","Install ContextForge with Docker Compose",[86,89,92],{"title":87,"body":88},"Generate the secrets","In a dedicated folder, write a `.env` file with the domain name, the administrator password and two separate secrets: `SECRET_KEY` signs the tokens, `ENCRYPTION_KEY_HEX64` encrypts the credentials of the servers you register. ContextForge refuses to start with secrets that are too short or left at their example value.\n```bash\nmkdir -p \u002Fopt\u002Fcontextforge && cd \u002Fopt\u002Fcontextforge\ncat > .env \u003C\u003CEOF\nDOMAIN=mcp.example.com\nADMIN_PASSWORD=$(openssl rand -base64 18)\nSECRET_KEY=$(openssl rand -hex 32)\nENCRYPTION_KEY_HEX64=$(openssl rand -hex 32)\nEOF\nchmod 600 .env\n```",{"title":90,"body":91},"Write the docker-compose.yml file","The image runs as an unprivileged user (uid 10001): the `contextforge-init` service makes the volume writable before start-up. `AUTH_REQUIRED` and `MCP_REQUIRE_AUTH` lock the API and the MCP endpoint, and the port is published on the loopback interface only. `DEFAULT_USER_PASSWORD`, the temporary password of accounts created without one, is drawn at random on every start.\n```yaml\nservices:\n  contextforge-init:\n    image: ghcr.io\u002Fibm\u002Fmcp-context-forge:v1.1.1\n    user: \"0:0\"\n    entrypoint: [\"chown\", \"-R\", \"10001:10001\", \"\u002Fapp\u002Fdata\"]\n    restart: \"no\"\n    volumes:\n      - contextforge-data:\u002Fapp\u002Fdata\n\n  contextforge:\n    image: ghcr.io\u002Fibm\u002Fmcp-context-forge:v1.1.1\n    restart: unless-stopped\n    depends_on:\n      contextforge-init:\n        condition: service_completed_successfully\n    environment:\n      HOST: \"0.0.0.0\"\n      PORT: \"4444\"\n      ENVIRONMENT: \"production\"\n      APP_DOMAIN: \"https:\u002F\u002F${DOMAIN}\"\n      ALLOWED_ORIGINS: \"https:\u002F\u002F${DOMAIN}\"\n      DATABASE_URL: \"sqlite:\u002F\u002F\u002F\u002Fapp\u002Fdata\u002Fmcp.db\"\n      CACHE_TYPE: \"database\"\n      GUNICORN_WORKERS: \"2\"\n      MCPGATEWAY_UI_ENABLED: \"true\"\n      MCPGATEWAY_ADMIN_API_ENABLED: \"true\"\n      AUTH_REQUIRED: \"true\"\n      MCP_CLIENT_AUTH_ENABLED: \"true\"\n      MCP_REQUIRE_AUTH: \"true\"\n      EMAIL_AUTH_ENABLED: \"true\"\n      PLATFORM_ADMIN_EMAIL: \"admin@example.com\"\n      PLATFORM_ADMIN_PASSWORD: \"${ADMIN_PASSWORD}\"\n      JWT_SECRET_KEY: \"${SECRET_KEY}\"\n      AUTH_ENCRYPTION_SECRET: \"${ENCRYPTION_KEY_HEX64}\"\n    entrypoint: [\"\u002Fbin\u002Fbash\", \"-c\"]\n    command:\n      - |\n        export DEFAULT_USER_PASSWORD=\"$$(python3 -c 'import secrets; print(secrets.token_urlsafe(24))')\"\n        exec .\u002Fdocker-entrypoint.sh\n    ports:\n      - \"127.0.0.1:4444:4444\"\n    volumes:\n      - contextforge-data:\u002Fapp\u002Fdata\n\nvolumes:\n  contextforge-data: {}\n```",{"title":93,"body":94},"Start and check","Start the stack, then query the health endpoint. The first time, ContextForge creates its database and the administrator account; the container turns `healthy` in under a minute.\n```bash\ndocker compose up -d\ndocker compose ps\ncurl -s http:\u002F\u002F127.0.0.1:4444\u002Fhealth\n```\nThe expected answer is `{\"status\":\"healthy\"}`. Any other route, `\u002Ftools` or `\u002Fversion` for example, answers 401 without a token.",{"type":96,"title":97,"body":98},"tip","Never disable authentication","An open MCP gateway hands anyone the tools you plugged into it — and the credentials that come with them. Keep `AUTH_REQUIRED` and `MCP_REQUIRE_AUTH` at `true`, the port on `127.0.0.1`, and leave nginx alone facing the Internet.",{"type":39,"title":100,"body":101},"Publish ContextForge over HTTPS with nginx","Create a server block in `\u002Fetc\u002Fnginx\u002Fsites-available\u002F` and enable it. `X-Forwarded-Proto` matters: the console compares the origin of the login form with the request address, and refuses the login if they differ. `proxy_buffering off` lets the MCP protocol's streamed responses through.\n```nginx\nserver {\n    server_name mcp.example.com;\n\n    location \u002F {\n        proxy_pass http:\u002F\u002F127.0.0.1:4444;\n        proxy_http_version 1.1;\n        proxy_set_header Host $host;\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n        proxy_set_header X-Forwarded-Proto $scheme;\n        proxy_buffering off;\n        proxy_read_timeout 300s;\n    }\n}\n```\nCheck the configuration, then request the certificate:\n```bash\nsudo nginx -t && sudo systemctl reload nginx\nsudo certbot --nginx -d mcp.example.com\n```",{"type":39,"title":103,"body":104},"Log in and create an API token","Open `https:\u002F\u002Fmcp.example.com\u002Fadmin` and log in with `admin@example.com` and the password from the `.env` file. The console can create tokens; so can the API. The login returns a short-lived session token, used to create a named API token, valid for 30 days here:\n```bash\nSESSION=$(curl -s https:\u002F\u002Fmcp.example.com\u002Fauth\u002Femail\u002Flogin -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"email\":\"admin@example.com\",\"password\":\"YOUR_PASSWORD\"}' | jq -r .access_token)\nTOKEN=$(curl -s https:\u002F\u002Fmcp.example.com\u002Ftokens -H \"Authorization: Bearer $SESSION\" -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"name\":\"agent-1\",\"expires_in_days\":30}' | jq -r .access_token)\n```\nCreate one token per client or agent: you can revoke one without touching the others.",{"type":39,"title":106,"body":107},"Turn a REST API into an MCP tool","A REST tool is declared by its URL, its method and the schema of its parameters. The example below exposes GitHub's public `zen` API, which returns a sentence and expects no parameter:\n```bash\ncurl -s https:\u002F\u002Fmcp.example.com\u002Ftools -H \"Authorization: Bearer $TOKEN\" -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"tool\":{\"name\":\"github_zen\",\"url\":\"https:\u002F\u002Fapi.github.com\u002Fzen\",\"integration_type\":\"REST\",\"request_type\":\"GET\",\"input_schema\":{\"type\":\"object\",\"properties\":{}}}}' \\\n  | jq -r .id\n```\nThe command prints the tool's ID. On the MCP side, its name becomes `github-zen`. For an internal API, replace the URL and describe its parameters in `input_schema`: that schema is what the agent reads to know how to call it.",{"type":39,"title":109,"body":110},"Group the tools and connect an MCP client","A virtual server groups tools under one MCP address. Create it with the tool's ID:\n```bash\ncurl -s https:\u002F\u002Fmcp.example.com\u002Fservers -H \"Authorization: Bearer $TOKEN\" -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"server\":{\"name\":\"demo\",\"associated_tools\":[\"TOOL_ID\"]}}' | jq -r .id\n```\nThen check, as a client would, that the tool is listed:\n```bash\ncurl -s https:\u002F\u002Fmcp.example.com\u002Fservers\u002FSERVER_ID\u002Fmcp -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Accept: application\u002Fjson, text\u002Fevent-stream\" -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"tools\u002Flist\"}'\n```\nIn your MCP client, declare the virtual server's address and the token. The exact form depends on the client; many accept an entry like this one:\n```json\n{\n  \"mcpServers\": {\n    \"contextforge\": {\n      \"type\": \"http\",\n      \"url\": \"https:\u002F\u002Fmcp.example.com\u002Fservers\u002FSERVER_ID\u002Fmcp\",\n      \"headers\": { \"Authorization\": \"Bearer YOUR_TOKEN\" }\n    }\n  }\n}\n```",{"type":39,"title":112,"body":113},"Back up and update","What to back up: the `contextforge-data` volume, which holds the SQLite database — tools, servers, users and tokens — and the `.env` file. Without `ENCRYPTION_KEY_HEX64`, the encrypted credentials in the database can no longer be read. Stop the service while copying:\n```bash\ncd \u002Fopt\u002Fcontextforge\ndocker compose stop contextforge\ndocker compose cp contextforge:\u002Fapp\u002Fdata .\u002Fbackup-$(date +%F)\ndocker compose start contextforge\n```\nTo update, change the image tag in both services after reading the release notes, then:\n```bash\ndocker compose pull\ndocker compose up -d\n```\nContextForge applies its database migrations on start-up: take the backup first.",{"type":39,"title":115,"body":116},"One-click installation on ServOrbit","On a ServOrbit VPS, ContextForge installs from the Marketplace: the script deploys the official image, generates the administrator password and the secrets, locks the instance against any request without a token and configures nginx over HTTPS. The address is a subdomain of one of your domains or the VPS's free subdomain, certificate included, and the password is shown in your client area.","Your MCP gateway on a VPS","A ServOrbit Ubuntu 24.04 VPS with 2 GB of RAM is enough for ContextForge. One-click installation from the Marketplace, HTTPS on your domain or on the VPS's free subdomain, password generated for you.","Install ContextForge","\u002Fapplications\u002Fartificial-intelligence\u002Fcontextforge",[122,144,163],{"id":123,"slug":124,"slugs":125,"title":129,"excerpt":130,"readTime":131,"views":132,"isPinned":19,"noindex":19,"publishedAt":133,"updatedAt":134,"category":135,"categories":141,"featuredImage":29,"bgImage":30,"posterImage":143,"relatedSolution":29},214,"how-to-deploy-an-mcp-server-on-a-vps",{"fr":126,"en":124,"ar":127,"es":128},"mcp-serveur-ia-auto-heberge-vps","كيفية-نشر-خادم-mcp-على-vps","desplegar-servidor-mcp-en-un-vps","Deploy a Self-Hosted MCP Server on a VPS","Complete guide to deploying, securing and integrating an MCP server on your VPS: nginx, TLS, authentication, troubleshooting and connection to Claude Desktop.",8,4,"2026-08-03T00:00:00+00:00","2026-10-20T23:18:06+00:00",{"id":136,"name":137,"slug":138,"color":139,"icon":140},1,"Artificial Intelligence","intelligence-artificielle","bg-purple-500\u002F10 text-purple-400","ia",[142],{"id":136,"name":137,"slug":138,"color":139,"icon":140},"\u002Fblog\u002Fcovers\u002Fmcp-serveur-ia-auto-heberge-vps-poster.svg",{"id":145,"slug":146,"slugs":147,"title":151,"excerpt":152,"readTime":153,"views":154,"isPinned":19,"noindex":19,"publishedAt":155,"updatedAt":156,"category":157,"categories":158,"featuredImage":29,"bgImage":30,"posterImage":160,"relatedSolution":161},156,"self-host-litellm-on-a-vps-your-private-llm-api-gateway",{"fr":148,"en":146,"ar":149,"es":150},"self-host-litellm-vps","استضف-litellm-ذاتيا-على-vps-بوابة-api-خاصة-لنماذج-llm","alojar-litellm-en-un-vps-pasarela-llm-privada","Self-Host LiteLLM on a VPS: Your Private LLM API Gateway","Deploy LiteLLM on a ServOrbit VPS — a self-hosted, OpenAI-compatible gateway to Ollama, Anthropic, Azure and 100+ LLM providers, with spend tracking and rate limits.",9,3,"2026-01-21T00:00:00+00:00","2026-11-09T20:55:12+00:00",{"id":17,"name":23,"slug":24,"color":25,"icon":26},[159],{"id":17,"name":23,"slug":24,"color":25,"icon":26},"\u002Fblog\u002Fcovers\u002Fself-host-litellm-vps-poster.svg",{"categorySlug":33,"appSlug":162},"litellm",{"id":154,"slug":164,"slugs":165,"title":169,"excerpt":170,"readTime":171,"views":132,"isPinned":19,"noindex":19,"publishedAt":172,"updatedAt":173,"category":174,"categories":179,"featuredImage":29,"bgImage":30,"posterImage":181,"relatedSolution":182},"install-n8n-on-vps-with-docker-complete-2026-guide",{"fr":166,"en":164,"ar":167,"es":168},"installer-n8n-vps","تثبيت-n8n-على-vps-مع-docker-دليل-شامل-2026","instalar-n8n-en-vps-con-docker","Install n8n on VPS with Docker: complete 2026 guide","Deploy n8n on VPS with Docker, reverse proxy and HTTPS. Covers V8 crash, 502 nginx, npm migration and execution security (GHSA-vrv8-j27g-g7cr advisory, August 2026).",19,"2026-06-05T00:00:00+00:00","2026-11-10T14:39:01+00:00",{"id":175,"name":176,"slug":177,"color":178,"icon":177},2,"Automation","automatisation","bg-brand-action\u002F10 text-brand-action",[180],{"id":175,"name":176,"slug":177,"color":178,"icon":177},"\u002Fblog\u002Fcovers\u002Finstaller-n8n-vps-poster.svg",{"categorySlug":183,"appSlug":184},"automation-workflows","n8n",true,1794785344718]