OffshoreVps
Guides2 thg 10 20266 min readBy the OffshoreVps team

Deploy WordPress, Laravel, Next.js and Node.js on Web Hosting

How each kind of app is deployed on managed web hosting: one-click WordPress, Laravel with Composer, Next.js with Git, plus SSL, domains and email.

Modern web hosting plans are not just for WordPress. Our hosting plans support WordPress, Next.js, Node.js and Laravel/PHP apps, with Git deployment from GitHub or GitLab. This post explains how each type of app is deployed so you can choose the right path.

Terminal window on a VPS showing the commands used for deploying Laravel, Next.js and Node.js apps on web hosting, starting with “composer install --no-dev --optimize-autoloader”
The kind of commands you will run on your server in this guide.

Pick the right type of hosting for the app

  • WordPress and PHP apps (Laravel). Run well on web hosting. You get PHP, MySQL, cron jobs and a control panel.
  • Node.js and Next.js. Run as a long-lived Node process. Web hosting handles the process management for you.
  • Heavy or custom stacks. Need root access, background workers or special software? Move to a VPS.

Plans and what each includes are on the web hosting page.

WordPress: one-click install

Choose WordPress as the platform when you order, and it is installed for you. After it deploys, log in to the control panel, open WordPress and finish the site setup. Add a plugin for caching if you want extra speed.

Laravel and PHP apps

  1. Connect your Git repository from the control panel, or upload the files.
  2. Set the web root to the public folder.
  3. Create a MySQL database and put its details in .env.
  4. Run the usual commands (over SSH on plans that include it):
composer install --no-dev --optimize-autoloader
php artisan key:generate
php artisan migrate --force
php artisan config:cache

Add a cron entry for scheduled tasks:

* * * * * cd /path/to/app && php artisan schedule:run >> /dev/null 2>&1
The steps of this guide in order: 1. Pick the right type of hosting for the app; 2. WordPress: one-click install; 3. Laravel and PHP apps; 4. Next.js and Node.js; 5. Domains, SSL and email; 6. When a VPS is the better fit
The steps in this guide, in order.

Next.js and Node.js

  1. Push your project to GitHub or GitLab and connect it in the control panel.
  2. Set the build command and start command, for Next.js usually:
npm ci
npm run build
npm start
  1. Set environment variables for secrets in the panel instead of committing them.
  2. Redeploy by pushing to your branch.

Check that your app listens on the port the panel gives it, and reads it from process.env.PORT.

Domains, SSL and email

Every plan includes free SSL, and the first-year domain is free. Point the domain at the hosting account, wait for DNS to update and the certificate is issued for you. See DNS records explained. Free email with unlimited mailboxes is included.

When a VPS is the better fit

Choose a VPS when you need to run background services, a database you tune yourself, Docker, or anything that web hosting does not allow. The Nginx and HTTPS guide covers that path.