{"id":4643,"date":"2025-04-10T08:08:45","date_gmt":"2025-04-10T15:08:45","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/self-hosted-ai-chatbot-docker-couchbase-capella\/"},"modified":"2025-04-10T08:08:45","modified_gmt":"2025-04-10T15:08:45","slug":"self-hosted-ai-chatbot-docker-couchbase-capella","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/self-hosted-ai-chatbot-docker-couchbase-capella\/","title":{"rendered":"Self-Hosted AI Chatbots with Docker and Couchbase Capella"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">AI chatbots have become an essential tool for businesses and organizations. But most chatbot solutions depend on cloud-based models that introduce latency, API limitations, and perhaps most importantly, privacy concerns. What if you could run an AI chatbot entirely on your machine and still retain conversation history with a fully featured data platform?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this post, we\u2019ll walk through setting up a self-hosted AI chatbot using Docker Model Runner, a brand new feature from Docker that lets you run containerized models locally for inference and more, and Couchbase Capella to store, retrieve and search through conversations. The result is a fast, private and flexible chatbot that you control.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Ready to get started? Let\u2019s get going!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Setting up Docker Model Runner<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">First, let\u2019s ensure that your Docker Desktop and CLI version is up to date so that you have the Model Runner feature available to you. You do that by running <code>docker model status<\/code> from your terminal. If it is successful, you will see a success message outputted that <code>Docker Model Runner is running<\/code>. If you don\u2019t, then you need to first get the latest version of Docker and install it. After you update Docker, you can run that command again and it should work.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once you\u2019ve done so, you will use Docker Model Runner to pull the container image with the Llama 3.2 model and make it available locally:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>docker model pull ai\/llama3.3<\/code>\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can verify you successfully downloaded the Llama 3.2 model by running <code>docker model list<\/code> and you will see the model available to you for use:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>{\"object\":\"list\",\"data\":[{\"id\":\"ai\/llama3.3\",\"object\":\"model\",\"created\":1741794281,\"owned_by\":\"docker\"}]}<\/code>\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Want to test it out? Opening up the model in interactive mode is quite easy! Just run <code>docker model run ai\/llama3.3<\/code> from the command line and you will enter the interactive mode:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\n<code>Interactive chat mode started. Type \u2018\/bye\u2019 to exit.<br>\n<\/code><code>&gt;<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now that you have Llama 3.2 downloaded and ready to use, it\u2019s time to build a straightforward backend application that leverages the model for a self-hosted AI chatbot.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Creating the chatbot<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The application you will create will accomplish the following tasks:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Run Llama 3.2 locally via the <code>docker model run<\/code>\u00a0CLI command<\/li>\n\n\n<li>Send user messages as prompts to the model<\/li>\n\n\n<li>Store chat history in Couchbase Capella<\/li>\n\n\n<li>Retrieve previous chats<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Your application will be fully featured and ready to use immediately from your console as a robust AI powered chatbot. The code we build together here will provide you with the foundation to refactor it according to whatever needs you have. Perhaps, you wish to turn it into a backend for a web application. A few modifications will be all that is required to make that possible.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The application requires a couple of dependencies so from the project directory run <code>npm install couchbase readline-sync<\/code>. We use the Couchbase Node.js SDK to interact with our Couchbase Capella data store, and we use <code>readline-sync<\/code> to have the application interact with the user from the terminal.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Make sure you have set up a bucket in Capella to store the chat data, and have your Capella credentials at hand. As always, do not save your credentials in any version control. Use environment variables for local development to keep your credentials secure and not in public hands.\u00a0<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We are building four functions in our application:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>askAI<\/code> to encapsulate the process of feeding the message to our locally run AI model<\/li>\n\n\n<li><code>storeChat<\/code> to send the chat history to Capella<\/li>\n\n\n<li><code>fetchChatHistory<\/code> to retrieve chat chats<\/li>\n\n\n<li><code>main<\/code> to act as the primary interface for the application<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s start with the <code>main<\/code> function that\u2019ll wrap all the rest. This function will create a loop that the user can exit at any time offering a continuous chat experience:<\/p>\n\n\n<p>[crayon nums=&#8221;false&#8221; lang=&#8221;default&#8221; decode=&#8221;true&#8221;]async function main() {<br \/>\n\u00a0const { cluster, collection } = await connectToCouchbase();<\/p>\n<p>\u00a0\u00a0console.log(&#8220;Self-Hosted AI Chatbot (Llama 3.2 + Capella)&#8221;);<br \/>\n\u00a0\u00a0console.log(&#8220;Type your message below. Type &#8216;history&#8217; to view past chats or &#8216;exit&#8217; to quit.n&#8221;);<\/p>\n<p>\u00a0\u00a0while (true) {<br \/>\n\u00a0\u00a0\u00a0\u00a0const userMessage = readlineSync.question(&#8220;&gt; &#8220;);<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0if (userMessage.toLowerCase() === &#8220;exit&#8221;) {<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0console.log(&#8220;Goodbye!&#8221;);<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0break;<br \/>\n\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0if (userMessage.toLowerCase() === &#8220;history&#8221;) {<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0const history = await fetchChatHistory(cluster);<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0console.log(&#8220;n\ud83d\udcdc Chat History:&#8221;);<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0history.forEach((chat) =&gt; {<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0console.log(`\ud83e\uddd1 ${chat.user}n\ud83e\udd16 ${chat.response}n`);<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0});<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0continue;<br \/>\n\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0console.log(&#8220;\ud83e\udd16 Thinking&#8230;&#8221;);<br \/>\n\u00a0\u00a0\u00a0\u00a0const aiResponse = await askAI(userMessage);<br \/>\n\u00a0\u00a0\u00a0\u00a0console.log(`\ud83e\udd16 ${aiResponse}n`);<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0await storeChat(collection, userMessage, aiResponse);<br \/>\n\u00a0\u00a0}<br \/>\n}[\/crayon]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">As you can see, we have introduced functionality built on top of Capella\u2019s data store, namely the ability to retrieve within the chat itself the previous chat history. This could be useful for a user to regain their chat context whenever they start up a new session.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now that we have the <code>main<\/code> function, let\u2019s create the supporting functions that it invokes, starting with the <code>askAI<\/code> function:<\/p>\n\n\n<p>[crayon nums=&#8221;false&#8221; lang=&#8221;default&#8221; decode=&#8221;true&#8221;]async function askAI(prompt) {<br \/>\n\u00a0\u00a0return new Promise((resolve, reject) =&gt; {<br \/>\n\u00a0\u00a0\u00a0\u00a0exec(<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0`docker model run ai\/llama3.3 &#8220;${prompt}&#8221;`,<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0(error, stdout, stderr) =&gt; {<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if (error) {<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0console.error(`Error running model: ${error.message}`);<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0reject(error);<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if (stderr) {<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0console.error(`Docker stderr: ${stderr}`);<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0resolve(stdout.trim()); \/\/ Return AI response<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<br \/>\n\u00a0\u00a0\u00a0\u00a0);<br \/>\n\u00a0\u00a0});<br \/>\n}[\/crayon]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next, the <code>storeChat<\/code> function:<\/p>\n\n\n<p>[crayon nums=&#8221;false&#8221; lang=&#8221;default&#8221; decode=&#8221;true&#8221;]async function storeChat(collection, userMessage, aiResponse) {<br \/>\n\u00a0\u00a0const chatDoc = {<br \/>\n\u00a0\u00a0\u00a0\u00a0user: userMessage,<br \/>\n\u00a0\u00a0\u00a0\u00a0response: aiResponse,<br \/>\n\u00a0\u00a0\u00a0\u00a0timestamp: new Date().toISOString(),<br \/>\n\u00a0\u00a0};<\/p>\n<p>\u00a0\u00a0await collection.upsert(`chat_${Date.now()}`, chatDoc);<br \/>\n}[\/crayon]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Finally, the <code>fetchChatHistory<\/code> function:<\/p>\n\n\n<p>[crayon nums=&#8221;false&#8221; lang=&#8221;default&#8221; decode=&#8221;true&#8221;]async function fetchChatHistory(cluster, limit = 5) {<br \/>\n\u00a0\u00a0const query = `<br \/>\n\u00a0\u00a0\u00a0\u00a0SELECT user, response, timestamp FROM `chatbot`<br \/>\n\u00a0\u00a0\u00a0\u00a0ORDER BY timestamp DESC<br \/>\n\u00a0\u00a0\u00a0\u00a0LIMIT ${limit};<br \/>\n\u00a0\u00a0`;<br \/>\n\u00a0\u00a0const result = await cluster.query(query);<br \/>\n\u00a0\u00a0return result.rows;<br \/>\n}[\/crayon]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once you have finished with the functions, make sure to add <code>require<\/code> statements at the top of the file, and to create a connection to Couchbase Capella cluster:<\/p>\n\n\n<p>[crayon nums=&#8221;false&#8221; lang=&#8221;default&#8221; decode=&#8221;true&#8221;]const { exec } = require(&#8220;child_process&#8221;);<br \/>\nconst readlineSync = require(&#8220;readline-sync&#8221;);<br \/>\nconst couchbase = require(&#8220;couchbase&#8221;);<br \/>\nrequire(&#8220;dotenv&#8221;).config();<\/p>\n<p>async function connectToCouchbase() {<br \/>\n\u00a0\u00a0try {<br \/>\n\u00a0\u00a0\u00a0\u00a0const cluster = await couchbase.connect(COUCHBASE_URL, {<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0username: COUCHBASE_USERNAME,<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0password: COUCHBASE_PASSWORD,<br \/>\n\u00a0\u00a0\u00a0\u00a0});<br \/>\n\u00a0\u00a0\u00a0\u00a0const bucket = cluster.bucket(&#8220;chatbot&#8221;);<br \/>\n\u00a0\u00a0\u00a0\u00a0const collection = bucket.defaultCollection();<br \/>\n\u00a0\u00a0\u00a0\u00a0console.log(&#8220;Connected to Couchbase Capella&#8221;);<br \/>\n\u00a0\u00a0\u00a0\u00a0return { cluster, collection };<br \/>\n\u00a0\u00a0} catch (err) {<br \/>\n\u00a0\u00a0\u00a0\u00a0console.error(&#8220;Failed to connect to Couchbase:&#8221;, err);<br \/>\n\u00a0\u00a0\u00a0\u00a0process.exit(1);<br \/>\n\u00a0\u00a0}<br \/>\n}[\/crayon]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Lastly, don&#8217;t forget to add a line at the end of your script that calls the <code>main<\/code> function by inserting <code>main();<\/code> on the last line.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once finished, you have a fully ready AI chatbot hosted on your own machine retaining your privacy and simultaneously leveraging Capella for storage and retrieval.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Using your self-hosted AI chatbot<br>\n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Your very own chatbot is ready to use! Every query you send it will be processed only locally on your machine using the Llama 3.2 model. Nothing will be sent to any AI provider remotely.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you\u2019re ready to give it a spin, do so by running the following:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\n<code>node index.js # or whatever you named your file<\/code>\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once you run it, you will see the following:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\n<code>Connected to Couchbase Capella<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>Self-Hosted AI Chatbot (Llama 3.2 + Capella)<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>Type your message below. Type 'history' to view past chats or 'exit' to quit.<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>&gt;<\/code>\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Go ahead and start asking questions and interacting with it. Here\u2019s a brief example of what you can expect to see:<\/p>\n\n\n<p>[crayon nums=&#8221;false&#8221; lang=&#8221;default&#8221; decode=&#8221;true&#8221;]Connected to Couchbase Capella<\/p>\n<p>\ud83d\ude80 Self-Hosted AI Chatbot (Llama 3.2 + Capella)<br \/>\nType your message below. Type &#8216;history&#8217; to view past chats or &#8216;exit&#8217; to quit.<\/p>\n<p>&gt; Should I pack a raincoat for Barcelona for a trip there at the end of March? Answer only with &#8220;yes&#8221; or &#8220;no&#8221;.<br \/>\n\ud83e\udd16 Thinking&#8230;<br \/>\n\ud83e\udd16 Yes.<\/p>\n<p>&gt; Tell me why I should pack a raincoat for Barcelona at the end of March. Limit your answer to 15 words or less.<br \/>\n\ud83e\udd16 Thinking&#8230;<br \/>\n\ud83e\udd16 You may need a raincoat as March weather in Barcelona can be unpredictable and rainy, up to 10C.<\/p>\n<p>&gt; exit<br \/>\n\ud83d\udc4b Goodbye![\/crayon]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">By using the scalability and security of Couchbase Capella along with Docker Model Runner\u2019s privacy-first approach to running AI models locally, you can build dynamic AI applications that prioritize user privacy. Running models on your own machine also gives you faster inference, full control over prompt customization, the ability to store additional metadata, and the flexibility to fine-tune your chatbot\u2019s behavior, all within your own environment.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This combination of Capella and Docker Model Runner gives you speed, control and the privacy needed to build AI applications without relying on external APIs. Whether you\u2019re creating a chatbot, analyzing data or running AI-powered workflows, this setup ensures that anything you build will be efficient, scalable and fully under your control. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The only question is: What will you build?<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.couchbase.com\/developers\/community\/\">Connect with our developer community<\/a> and show us what you are building!<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><br><br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>AI chatbots have become an essential tool for businesses and organizations. But most chatbot solutions depend on cloud-based models that introduce latency, API limitations, and perhaps most importantly, privacy concerns. What if you could run an AI chatbot entirely on your machine and still retain conversation history with a fully featured data platform? In this [&hellip;]<\/p>\n","protected":false},"author":85356,"featured_media":4640,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"_acf":"","footnotes":""},"categories":[920,598,136,727],"tags":[839],"ppma_author":[852],"class_list":["post-4643","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-agentic-ai-apps","category-artificial-intelligence-ai","category-best-practices-and-tutorials","category-generative-ai-genai","tag-genai"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.6 (Yoast SEO v27.6) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Self-Hosted AI Chatbots with Docker and Couchbase Capella - The Couchbase Blog<\/title>\n<meta name=\"description\" content=\"Build a private, self-hosted AI chatbot using Docker Model Runner &amp; Couchbase Capella. Fast, flexible, and fully under your control\u2014no external APIs needed.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.couchbase.com\/blog\/self-hosted-ai-chatbot-docker-couchbase-capella\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Self-Hosted AI Chatbots with Docker and Couchbase Capella\" \/>\n<meta property=\"og:description\" content=\"Build a private, self-hosted AI chatbot using Docker Model Runner &amp; Couchbase Capella. Fast, flexible, and fully under your control\u2014no external APIs needed.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/self-hosted-ai-chatbot-docker-couchbase-capella\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-10T15:08:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/blog-ai-agent-development.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2400\" \/>\n\t<meta property=\"og:image:height\" content=\"1256\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Ben Greenberg, Senior Developer Evangelist\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ben Greenberg, Senior Developer Evangelist\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/self-hosted-ai-chatbot-docker-couchbase-capella\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/self-hosted-ai-chatbot-docker-couchbase-capella\\\/\"},\"author\":{\"name\":\"Ben Greenberg, Senior Developer Evangelist\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/person\\\/48efa1524aec97312d92f65a270c255d\"},\"headline\":\"Self-Hosted AI Chatbots with Docker and Couchbase Capella\",\"datePublished\":\"2025-04-10T15:08:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/self-hosted-ai-chatbot-docker-couchbase-capella\\\/\"},\"wordCount\":1345,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/self-hosted-ai-chatbot-docker-couchbase-capella\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/05\\\/blog-ai-agent-development.jpg\",\"keywords\":[\"GenAI\"],\"articleSection\":[\"Agentic AI Applications\",\"Artificial Intelligence (AI)\",\"Best Practices and Tutorials\",\"Generative AI (GenAI)\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/self-hosted-ai-chatbot-docker-couchbase-capella\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/self-hosted-ai-chatbot-docker-couchbase-capella\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/self-hosted-ai-chatbot-docker-couchbase-capella\\\/\",\"name\":\"Self-Hosted AI Chatbots with Docker and Couchbase Capella - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/self-hosted-ai-chatbot-docker-couchbase-capella\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/self-hosted-ai-chatbot-docker-couchbase-capella\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/05\\\/blog-ai-agent-development.jpg\",\"datePublished\":\"2025-04-10T15:08:45+00:00\",\"description\":\"Build a private, self-hosted AI chatbot using Docker Model Runner & Couchbase Capella. Fast, flexible, and fully under your control\u2014no external APIs needed.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/self-hosted-ai-chatbot-docker-couchbase-capella\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/self-hosted-ai-chatbot-docker-couchbase-capella\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/self-hosted-ai-chatbot-docker-couchbase-capella\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/05\\\/blog-ai-agent-development.jpg\",\"contentUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/05\\\/blog-ai-agent-development.jpg\",\"width\":2400,\"height\":1256},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/self-hosted-ai-chatbot-docker-couchbase-capella\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Self-Hosted AI Chatbots with Docker and Couchbase Capella\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/\",\"name\":\"The Couchbase Blog\",\"description\":\"Couchbase, the NoSQL Database\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/06\\\/logo.svg\",\"contentUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/06\\\/logo.svg\",\"width\":\"1024\",\"height\":\"1024\",\"caption\":\"The Couchbase Blog\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/person\\\/48efa1524aec97312d92f65a270c255d\",\"name\":\"Ben Greenberg, Senior Developer Evangelist\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/365b64ca9dda70fb57c32645f0ae9d61350022d36a9b7d264e2668ad1741e0d3?s=96&d=mm&r=g8058b8c8566f325c9af22e5182088ccb\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/365b64ca9dda70fb57c32645f0ae9d61350022d36a9b7d264e2668ad1741e0d3?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/365b64ca9dda70fb57c32645f0ae9d61350022d36a9b7d264e2668ad1741e0d3?s=96&d=mm&r=g\",\"caption\":\"Ben Greenberg, Senior Developer Evangelist\"},\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/author\\\/bengreenberg\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Self-Hosted AI Chatbots with Docker and Couchbase Capella - The Couchbase Blog","description":"Build a private, self-hosted AI chatbot using Docker Model Runner & Couchbase Capella. Fast, flexible, and fully under your control\u2014no external APIs needed.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.couchbase.com\/blog\/self-hosted-ai-chatbot-docker-couchbase-capella\/","og_locale":"en_US","og_type":"article","og_title":"Self-Hosted AI Chatbots with Docker and Couchbase Capella","og_description":"Build a private, self-hosted AI chatbot using Docker Model Runner & Couchbase Capella. Fast, flexible, and fully under your control\u2014no external APIs needed.","og_url":"https:\/\/www.couchbase.com\/blog\/self-hosted-ai-chatbot-docker-couchbase-capella\/","og_site_name":"The Couchbase Blog","article_published_time":"2025-04-10T15:08:45+00:00","og_image":[{"width":2400,"height":1256,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/blog-ai-agent-development.jpg","type":"image\/jpeg"}],"author":"Ben Greenberg, Senior Developer Evangelist","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Ben Greenberg, Senior Developer Evangelist","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/self-hosted-ai-chatbot-docker-couchbase-capella\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/self-hosted-ai-chatbot-docker-couchbase-capella\/"},"author":{"name":"Ben Greenberg, Senior Developer Evangelist","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/48efa1524aec97312d92f65a270c255d"},"headline":"Self-Hosted AI Chatbots with Docker and Couchbase Capella","datePublished":"2025-04-10T15:08:45+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/self-hosted-ai-chatbot-docker-couchbase-capella\/"},"wordCount":1345,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/self-hosted-ai-chatbot-docker-couchbase-capella\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/blog-ai-agent-development.jpg","keywords":["GenAI"],"articleSection":["Agentic AI Applications","Artificial Intelligence (AI)","Best Practices and Tutorials","Generative AI (GenAI)"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/self-hosted-ai-chatbot-docker-couchbase-capella\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/self-hosted-ai-chatbot-docker-couchbase-capella\/","url":"https:\/\/www.couchbase.com\/blog\/self-hosted-ai-chatbot-docker-couchbase-capella\/","name":"Self-Hosted AI Chatbots with Docker and Couchbase Capella - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/self-hosted-ai-chatbot-docker-couchbase-capella\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/self-hosted-ai-chatbot-docker-couchbase-capella\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/blog-ai-agent-development.jpg","datePublished":"2025-04-10T15:08:45+00:00","description":"Build a private, self-hosted AI chatbot using Docker Model Runner & Couchbase Capella. Fast, flexible, and fully under your control\u2014no external APIs needed.","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/self-hosted-ai-chatbot-docker-couchbase-capella\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/self-hosted-ai-chatbot-docker-couchbase-capella\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/self-hosted-ai-chatbot-docker-couchbase-capella\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/blog-ai-agent-development.jpg","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/blog-ai-agent-development.jpg","width":2400,"height":1256},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/self-hosted-ai-chatbot-docker-couchbase-capella\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Self-Hosted AI Chatbots with Docker and Couchbase Capella"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"The Couchbase Blog","description":"Couchbase, the NoSQL Database","publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"The Couchbase Blog","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/06\/logo.svg","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/06\/logo.svg","width":"1024","height":"1024","caption":"The Couchbase Blog"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/48efa1524aec97312d92f65a270c255d","name":"Ben Greenberg, Senior Developer Evangelist","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/365b64ca9dda70fb57c32645f0ae9d61350022d36a9b7d264e2668ad1741e0d3?s=96&d=mm&r=g8058b8c8566f325c9af22e5182088ccb","url":"https:\/\/secure.gravatar.com\/avatar\/365b64ca9dda70fb57c32645f0ae9d61350022d36a9b7d264e2668ad1741e0d3?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/365b64ca9dda70fb57c32645f0ae9d61350022d36a9b7d264e2668ad1741e0d3?s=96&d=mm&r=g","caption":"Ben Greenberg, Senior Developer Evangelist"},"url":"https:\/\/www.couchbase.com\/blog\/author\/bengreenberg\/"}]}},"acf":[],"authors":[{"term_id":852,"user_id":85356,"is_guest":0,"slug":"bengreenberg","display_name":"Ben Greenberg, Senior Developer Evangelist","avatar_url":{"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/T024FJS4M-U075H3NTJUR-b4c321d902e2-512-23.jpeg","url2x":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/T024FJS4M-U075H3NTJUR-b4c321d902e2-512-23.jpeg"},"author_category":"","first_name":"Ben","last_name":"Greenberg, Senior Developer Evangelist","user_url":"","job_title":"","description":""}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/4643","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/users\/85356"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/comments?post=4643"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/4643\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media\/4640"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media?parent=4643"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=4643"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=4643"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=4643"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}