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:
- The StartKit.AI code
- An AI provider API key
- A MongoDB database
- An S3 Bucket to store data
- 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:
DigitalOcean deploy button for the StartKit.AI Starter plan:
Configuration
1. Resources
After clicking the button you’ll be greeted by this page:
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.
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.
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:
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
.
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:
To connect to Atlas from DigitalOcean you’ll need to allow access from the Atlas settings here:
- Go to Security -> Network Access in the sidebar
- Click Add IP Address and set Access List Entry: 0.0.0.0/0
- Hit confirm!