Question

How to upload a static website from the build folder

First of all let me say that I am new to the Digital Ocean platform. I am currently exploring the ‘apps’ section and I am currently trying to upload a static website to an app without needing the overhead of an additional github repository. I created an app with the ‘static assets’ setup. I am now trying to figure out where to upload the What I would ideally would do is run a command similar like I would do in Firebase. It would go something like this:

firebase login

firebase use <yourprojectid>

Then in the build folder created by running npm build you would do the following:

firebase deploy

And it would upload the static build assets to the project.

Are similar commands available or do I need to use a public repo to host the website? Or can I drag and drop the files?


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
September 1, 2023
Accepted Answer

Hi there,

The DigitalOcean App Platform does not offer a drag-and-drop way of deploying sites.

The best way to deploy your static site to the App Platform is to use a GitHub repo. It does not have to be a public one, you can also use a private repository and keep your site files private.

After you’ve deployed your static site via GitHub, the next time you push your changes to your repository they will be automatically deployed to the App Platform, so it will be a matter of pushing your changes with:

git add . 
git commit -m "your commit" 
git push origin main

To get your changes from your local laptop to the App Platform.

You can define the build command in the App Platform so that you will not have to build your site locally and push the build folder, but it will be done on the App Platform itself.

Here is a step by step guide on how to do this:

https://www.digitalocean.com/community/tutorials/how-to-deploy-a-react-application-to-digitalocean-app-platform

Hope that this helps!

Best,

Bobby

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel