Deploy Nuxt on DigitalOcean App Platform
How to deploy Nuxt on DigitalOcean App Platform?
DigitalOcean App Platform allows you to build, deploy, and scale apps quickly using a simple, fully managed solution. They’ll handle the infrastructure, app runtimes and dependencies, so that you can push code to production in just a few clicks.
App Platform includes the following features:
- Build, deploy, manage, and scale apps.
- Secure apps automatically. They create, manage and renew your SSL certificates and also protect your apps from DDoS attacks.
- Support for Node.js, static sites, Python, Django, Go, PHP, Laravel, React, Ruby, Ruby on Rails, Gatsby, Hugo, container images.
- Deploy code directly from your GitHub and GitLab repositories. Automatically re-deploy the app when you push updates to your source code.
- Zero infrastructure management. App Platform uses open, cloud native standards and automatically analyzes your code, creates containers, and runs them on Kubernetes clusters.
- Highly scalable. Scale horizontally or vertically.
Prerequisites
This guide assumes you already have a Nuxt project to deploy. If you need a project, use the create-nuxt-app to get started.
Setup
- Link your repository: Create a new account on DigitalOcean and connect your GitHub or Gitlab account. Then select the repository you want to deploy.
- Choose a branch of your repo and a region to deploy your site.
-
Choose the service that suits your website.
Type Settings Server Web service - Build command yarn build& Run commandyarn startStatic Static Sites - Build command yarn generate& Output directorydistWarning: For the server type you need to change the HTTP port from 8080 to 3000 in the Web service settings.
More information at this article .
-
Add an environment variable called
HOSTwith the value0.0.0.0. You can also add any other environment variables manually in the key-value pair inputs.
Once you pass the process, you hit deploy and your site will be live on an autogenerated url as soon as the build is done.
Continuous deployment (CD)
Now that App Platform is connected to your repo, it will automatically build and publish your site any time you push a new change.
Add custom domains
Add your own domains to your site easily on Settings > Domains > Add domain or follow this How to Manage Domains in App Platform guide.
Deploy to DigitalOcean button
The Deploy to DigitalOcean Button allows users to launch an application onto App Platform. It can be embedded in the README file for GitHub repositories, allowing users who are browsing your repository to deploy your code in one click, adding a .yaml file into your repo. Check it out at How to Add a "Deploy to DigitalOcean" Button to Your Repository
Sébastien Chopin
Nazaré da Piedade
Nobu
川音리오
Maciek Palmowski
Nestor Vera
Daniel Roe
Yue Yang
Jeronimas
Clément Ollivier
Alexander Lichter
N3-rd
Adrien Zaganelli
Mag
Stefan Huber
Olga Bulat
Paiva
Florian Reuschel
Savas Vedova
HIJACK
Vinícius Alves
Kareem Dabbeet
Valentín Costa
Ryan Skinner
Alex Hirzel
Ajeet Chaulagain
René Eschke
Nico Devs
Muhammad
Naoki Hamada
Tom
Yann Aufray
Anthony Chu
Nuzhat Minhaz
Lucas Portet
Richard Schloss
Bobby
bpy
Antony Konstantinidis
Hibariya
Jose Seabra
Eze
Florian Lefebvre
Lucas Recoaro
Julien SEIXAS