DigitalOcean
Deploy Nitro apps to DigitalOcean.
Preset: digital_ocean
Set up application
Create a new DigitalOcean app following the guide.
Next, configure environment variables. In your app settings, ensure the following app-level environment variable is set:NITRO_PRESET=digital_ocean
More information.
NITRO_PRESET=digital_ocean
Set an engines.node field in your app's package.json so DigitalOcean uses a supported version of Node.js:{
"engines": {
"node": "20.x"
}
}
See more information.
{
"engines": {
"node": "20.x"
}
}
Add a start script to your package.json so DigitalOcean knows what command to run after a build:{
"scripts": {
"start": "node .output/server/index.mjs"
}
}
{
"scripts": {
"start": "node .output/server/index.mjs"
}
}
Finally, add this start script to your DigitalOcean app's run command. Go to Components > Settings > Commands, click "Edit", then add npm run start.
Your app should now be live at a DigitalOcean-generated URL, and you can follow the rest of the DigitalOcean deployment guide.