![Self-host the Next.js website on an Ubuntu server with Auto Deploy during commits!](https://ytimg.googleusercontent.com/vi/Dzajd46nyWo/hqdefault.jpg)
Note: I made a few errors trying to start the website using pm2. They are immediately corrected in the video. I decided to keep the error and correction in the video because I thought it was more helpful if you saw me make the error and correction first, since they are very common.
Introduction: 0:00
Server purchase: 2:43
Server setup: 6:04
SSH to extract: 11:28
Create a Next.js boilerplate: 2:00 p.m.
Clone Next.js on the server: 4:30 p.m.
NGINX configuration file: 18:29
Enable configuration file: 21:33
Launch the application with pm2: 24h00
– error pm2 1:24:48 (make sure to log into the application directory before launching)
– error pm2 2:26:02 (make sure to run the application on the same port that is in the configuration file)
Live on the next.js website: 27:02
Add a domain to the configuration file: 27:34 (also have access to DNS records on your domain name)
Add Free SSL: 30:01
Configure automatic deployment: 31:33
– Add private SSH to GitHub: 35:18
– Add GitHub actions with yml file: 36:21
–ESSENTIAL—
The basics for reference to all commands and configuration files used in the video:
Server setup: https://gist.github.com/oelbaga/5019647715e68815c602ff05cff2416e#file-01-setup-nextjs-site-on-ubuntu-server-terminal-commands
nginx configuration file: https://gist.github.com/oelbaga/5019647715e68815c602ff05cff2416e#file-02-nginx-config-file-for-nextjs-site
yml file for automatic deployment:
https://gist.github.com/oelbaga/5019647715e68815c602ff05cff2416e#file-04-github-actions-for-auto-deployment-deploy-yml
ssh steps for automatic deployment:
https://gist.github.com/oelbaga/5019647715e68815c602ff05cff2416e#file-03-auto-deployment-from-github-to-ubuntu-server
CONNECT ON MY DISCORD COMMUNITY:
https://discord.gg/5zsdrxH8m8
SOCIAL:
Twitter: https://twitter.com/omarel
Website: https://www.omarel.com
LinkedIn: https://www.linkedin.com/in/omarelbaga
GitHub: https://github.com/oelbaga
Please take the opportunity to connect and share this video with your friends and family if you find it useful.
No Comments