Skip to content

Deploy StartKit.AI to DigitalOcean

StartKit.AI will run effectively on a small $4/month DigitalOcean VPS, and this is probably the cheapest way to run your product. However, it’s much easier and faster to deploy to DigitalOcean’s App Platform, which will cost $10/month.

App Platform is a managed hosting environment, that you can deploy with a single click and will auto-scale your app when needed.

So let’s get deploying!

Getting started

If you haven’t already, then follow the Installation guide to get StartKit.AI running locally.

When you’ve completed installation you should have the following:

  1. The StartKit.AI code
  2. An AI provider API key
  3. A MongoDB database
  4. An S3 Bucket to store data
  5. A Pinecone index (optional)

Setup DigitalOcean

First you need to give DigitalOcean access to your GitHub account using this link, this lets them know what repos you can access:

https://github.com/apps/digitalocean/installations/select_target

You can now click this button to set-up a DigitalOcean App with our default options:

DigitalOcean deploy button for the StartKit.AI Growth plan:

Deploy to DO

Configuration

1. Resources

After clicking the button you’ll be greeted by this page:

DO resources

This shows that DigitalOcean will create two resources for you:

  • api: The StartKit.AI Node.js server
  • memory: The embeddings server that links with your Pinecone db to form your AIs memory.

2. Environment variables

The default environment variables will be prefilled for you on the next page, but the ones that you created during setup will need to be added. Such as your MongoDB Atlas database URL.

Click the “Edit” button next to the Global section, Click “Bulk Editor” and you can paste in your entire env file that we created during the setup process.

DO edit the environment variables

Now hit next.

3. Create the app

You don’t need to change any of the other settings, so click through to the end of the process and click “Create Resources”.

After a few minutes you should have StartKit.AI running.

DO Create Resources

4. Update the repo

What we’ve just deployed is a version of StartKit.AI from a template GitHub repo, we need to update this to your own repo.

Go to the App Settings page and click “Edit” on the App Spec setting:

Edit the App Spec

Find the github section, and change startkit-ai/startkit.ai value to the name of your repo.

For example if your project on GitHub is https://github.com/Jivings/my-ai-project, then you’d change the value to Jivings/my-ai-project.

Change GitHub repo in App Spec

Hit save and your app will re-deploy with your code instead of ours!

Now your app should be running! 🎉

Troubleshooting

GitHub user not authenticated

DigitalOcean throws this error when you click the last submit button. For some reason it doesn’t know that you have access to the StartKit.AI repo. You can usually solve it by clicking this link and granting access again: https://github.com/apps/digitalocean/installations/select_target.

Can’t access Mongo Atlas

Your StartKit.AI instance fails to start with this error:

MongooseServerSelectionError: Could not connect to any servers in your MongoDB Atlas cluster.

To connect to Atlas from DigitalOcean you’ll need to allow access from the Atlas settings here:

  1. Go to Security -> Network Access in the sidebar
  2. Click Add IP Address and set Access List Entry: 0.0.0.0/0
  3. Hit confirm!

Add IP Access List Entry