Deploying DocsGPT on DigitalOcean Droplet
Tags: gpt3, automl, ai, cloud
Published: 2023-11-06 13:46:36

![Cover](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yebo16y4nxd5159zhv6k.png)

## Introduction

DocsGPT is a smart AI assistant to aid all of your technical documentation needs. You can directly communicate with it through a chat interface and it will provide you with the required solution by going through the technical documentation of a given product on its own.

In this tutorial, you will learn how to self-host an instance of DocsGPT on a DigitalOcean cloud instance called Droplet.

## Initiating DigitalOcean Droplet

DigitalOcean is a famous cloud provider that provides affordable cloud solutions to its consumers. You will now deploy a cloud VM instance called Droplet on the DigitalOcean platform. Follow the steps below to create a Droplet easily.

**Step 1:** Log in to your DigitalOcean account to open your user dashboard. If you don't have an account yet, simply create one [here](https://try.digitalocean.com/cloud/). You can claim free credits worth $200 valid for 60 days to try the platform seamlessly.

![Sign up](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4yeh79yfm3wowhl6mewi.png)

**Step 2:** Once you are in the user dashboard, click on `Droplets` in the left navigation panel and then click on the `Create Droplet` button. This should take you to the new Droplet configuration wizard.

![Create Droplet](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/87rwsht0lofdphs4o3sr.png)

**Step 3:** On this page, you need to define the configuration for your cloud instance. You can define the configuration as per your needs but feel free to use the configuration given below to complete this tutorial.

- **Choose Region:** Choose the region closest to you to minimize latency.
- **Datacenter:** Leave it at default. If there are multiple options available for your region, then select the data center that falls closer to your geographic location.
- **VPC Network:** This is set to default.
- **Choose an image:** Click on the `OS` tab and then select `Ubuntu`.
- **Version:** 22.04 (LTS) x64 (You can also go for the latest 23.10 x64 version)
- **Choose Size:** Select the sub-options as follows.
     - **Droplet Type:** Basic (Plan Selected)
     - **CPU Options:** Regular [Disk Type: SSD]
     - **Plans:** $24/mo (4GB / 2 CPUs, 80GB SSD Disk, 4 TB Transfer)
     - **Additional Storage:** Leave it as it is.
- **Choose Authentication Method:** Select **Password**
     - **Create root password:** Provide a password for your root user.
- **Recommended Options:** Leave it as it is as we don't have any extra configuration required for this tutorial.
- **Finalize Details:** Use the sub-options as follows.
     - **Quantity:** 1 Droplet
     - **Hostname:** docsgpt-demo (You can provide any name.)
     - **Tags:** Leave it blank.
     - **Project:**  Select `Demo` or your `email` from the dropdown.

Now click on the `Create Droplet` button to start provisioning the VM.

![Create Droplet](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xup67pdfxl7vqkouqhc4.png)

**Step 4:** It will take some time for the instance to be up and running. Wait until the loading bar completes in the following screen and you see a green dot beside the Droplet name that confirms its running status.

![Droplet Boot up](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0exe9vaadj9vm079z86q.png)

**Step 5:** Now click on the droplet name i.e., `docsgpt-demo` and then click on `Console` on the next screen to log in to your Droplet. This will open a new terminal window.

![Console Menu](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mhlo2k4auo8q35wx92ss.png)

You are now ready to proceed with the installation of DocsGPT on your Droplet.

## Deploying DocsGPT

Now you need to follow the steps given below to successfully deploy DocsGPT on your cloud instance.

**Step 1:** Clone the DocsGPT repository to your instance. Use the command given below to do so.

```bash
git clone https://github.com/arc53/DocsGPT.git
```

![Git Clone](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c192kl7bizwjj2vkbyf8.png)

**Step 2:** Update the package indexes of your Ubuntu system with the command given below.

```bash
sudo apt update
```

![Update Packages](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jvcp0hh4h4vqawq6gf1e.png)

**Step 3:** DocsGPT needs containerization tools like `docker` and `docker-compose` to run. You can install them with the commands given below. Press `Y` when prompted to proceed with the installation.

```bash
sudo apt install docker docker-compose
```

![Docker Install](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5pei12v08zp4tn3745c9.png)

**Step 4:** The `.env` variables for DocsGPT need to be set. You can do so by going to the DocsGPT folder and adding a `.env` file.

```bash
cd DocsGPT/

nano .env
```

![Set .Env](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bscc2hfip9iouh1ndlsw.png)

Save the following values in the `.env` file.

```bash
LLM_NAME=DocsGPT-7b (You can choose any available LLM under DocsGPT)
API_KEY= <Your OpenAI API key>
VITE_API_STREAMING= true
```
You can exit the Nano editor by using `Ctrl + X` and then hitting `Y` followed by `Enter`.

**Step 5:** DocsGPT's front end needs to connect and communicate with its backend properly for its work. To do this, you need to edit the `docker-compose.yaml` file so that it points to the correct IP address of the backend. Use the command below to edit the file.

```bash
nano docker-compose.yaml
```

Find Line 7 in the editor and edit the `VITE_API_HOST` parameter. It should use the public IPv4 of your Droplet.

```bash
VITE_API_HOST=http://<Droplet Public IPv4>:7091
```

You can find the Publiv IPv4 of the Droplet on the Droplet details page.

![IPv4](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tjv81ik0w1vdy7rbsx81.png)

Now save the changes and exit the editor.

**Step 6:** You are now ready to run DocsGPT on your Droplet with the command given below. Remember that the initial startup time will be a bit longer as it requires downloading all the necessary dependencies and then building the app.

```bash
sudo docker-compose up -d
```

Once you see the `done` status of a list of DocsGPT jobs in the terminal, you're good to work with it on your Droplet.

![Status Done](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xcd34zdgagfos8c7313o.png)

## Working with DocsGPT

You can now access DocsGPT by visiting the following URL.

```bash
http://<Public Droplet IPv4:5173>
```
When you open this URL for the first time, you will need to choose a source documentation. Select `default` and click on `Save` to test the deployment.

![Source Documentation](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xoc0hq10qenpigemj9b8.png)

You can now ask generic questions about DocsGPT and it will provide you with the relevant answers.

```bash
You: What is DocsGPT?

DocsGPT: DocsGPT is an AI-powered language model developed using OpenAI's GPT (Generative Pre-trained Transformer) architecture. It is designed specifically to assist users in composing and editing documents. DocsGPT can help generate text in various formats, such as essays, code snippets, technical documentation, and more. It understands natural language commands and provides informative responses to user queries. Through its conversational interface, DocsGPT can assist with a wide range of document-related tasks, including content generation, formatting, organization, and more.
```

Your DocsGPT deployment is now ready to help you with any technical documentation needs.

## Conclusion

DocsGPT can be a great asset to save time by eliminating the need to manually search across docs to seek answers. The team behind this is working continuously to bring more features and upgrade the user experience. You also have the option to try their cloud version directly if you don't wish to host it by yourself.

The community is always welcome to try it out and provide their valuable feedback or suggest additional features by joining their [Discord](https://discord.com/invite/WHJdfbQDR4).

Lastly, before you leave, feel free to drop a Like if you loved reading this article, and don't forget to share it with your peers.


[![Banner](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7j3zyr5hp6lm2nrbxbhr.png)](https://docsgpt.arc53.com/)


[![Sponsor](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/62eudpkqh1cxxachfdbx.png)](https://github.com/sponsors/Rutam21)