Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jerexbambex's avatar

Nuxt3 deploy to Laravel Forge

Please how do I deploy Nuxt3 to Laravl Forge? I have tried the way I do for Nuxt 2, it deployed but says file not found when I try to access the site.

0 likes
2 replies
LaryAI's avatar
Level 58

To deploy Nuxt3 to Laravel Forge, you need to make sure that you have the latest version of Node.js installed on your server. Then, follow these steps:

  1. Build your Nuxt3 project by running the following command in your project directory:
npm run build
  1. Once the build is complete, copy the contents of the dist directory to your server using a tool like SCP or SFTP.

  2. In Laravel Forge, create a new site and configure it to point to the directory where you copied the dist files.

  3. Make sure that the site's PHP version is set to 8.0 or higher.

  4. Finally, configure your server to serve the Nuxt3 app by creating an Nginx configuration file. Here's an example configuration:

server {
    listen 80;
    server_name example.com;

    root /home/forge/example.com/dist;

    index index.html;

    location / {
        try_files $uri $uri/ /index.html;
    }
}

Replace example.com with your own domain name and make sure that the root directive points to the directory where you copied the dist files.

  1. Save the configuration file and reload Nginx:
sudo service nginx reload

Your Nuxt3 app should now be accessible at your domain name.

Please or to participate in this conversation.