Glitch makes it easy to deploy your apps to DigitalOcean just by clicking a button, but there are a few tips and tricks that will help you make sure your project is optimized for deployment and get you off to a successful launch!
App type
Deployment to DigitalOcean is supported for public full stack applications (for example, node.js), and public generated static sites (for example, React).
You will not be able to deploy any apps that are set to private or fully static (for example, a remix of the Glitch Hello Website project)–Glitch should only present the deploy controls in relevant projects.
Project name
To successfully deploy to DigitalOcean, your Glitch project name can only start with a letter (a-z), cannot end with a hyphen (-), and can only be up to 32 characters. This is because the Glitch project's name is used in the "name" configured for your DigitalOcean app, so it needs to follow DigitalOceans's app specification under "YAML File Structure" for "name."
Server IP
If you're deploying a node.js project, set the server IP explicitly in your code to 0.0.0.0
. You can see an example of this in ~glitch-hello-node, in the server.js
line running the server:
fastify.listen(process.env.PORT, '0.0.0.0', function(err, address) {
This ensures that the server will listen on all IPv4 addresses, which is necessary for deploying your app to DigitalOcean and other services. For more info on configuring your server with Fastify, check out the docs.
Your project will need to use NPM for dependency management–when you start the deploy process, Glitch will attempt to prepare the project dependency setup for a successful deployment.
Databases
If you're deploying an app backed by a database stored in a .data
file, like SQLite, your data will not automatically be copied over to your DigitalOcean deployment. If you're using a database as part of your project, you'll need to set that up in your DigitalOcean account–check out the docs on managing databases on App Platform.
Logs
Glitch will output messages to your project logs throughout the deployment process, including info passed back from DigitalOcean. You'll need some of this info to complete your initial deployment steps–Glitch will try to automatically carry out project preparation and initial deployment, but the steps will vary a little depending on the type of project you're working with and how its dependencies are being managed. Keep an eye on the Logs!
DigitalOcean Account
It's a good idea to keep your DigitalOcean account open in a tab while you're working through your deployment from Glitch–you'll see an overview of your deployed projects in the Apps section. Click one to see the progress of the deployment and build. Note that you can have a maximum of ten apps in your DigitalOcean account at any time, so if you're experiencing issues getting your apps to successfully deploy, you could try removing any unused apps from your account.
Playlist
We've set up a playlist of apps that demonstrate and make great starting points for DigitalOcean–check out the source code or hit the Remix button!