You are using an unsupported browser. Please update your browser to the latest version on or before July 31, 2020.
close
Home > FAQ > How do I set my project up for DigitalOcean deployment?
How do I set my project up for DigitalOcean deployment?
print icon

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.

 

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!

Got more questions? Check out our Community Forum!
Open 24/7, the forum is where Glitch makers help each other and show off all the rad apps that they have created. It's the friendliest community of coders on the Web!
Feedback
0 out of 0 found this helpful

scroll to top icon