This article provides a complete guide to create and host a Next.js website on Square Cloud.
my-app
is the name of your new project. You can replace my-app
with any name you want for your project. The npx
command is a tool that comes with npm
, the Node.js package manager. It is used to run Node.js packages that are installed locally in your project or are available remotely on the npm registry.
create-next-app
is a package available on the npm registry that sets up a new Next.js project automatically. It takes care of all the initial setup, such as creating the project directory, installing necessary dependencies, and configuring basic files.
@latest
is a tag specifying that you want to use the latest version of the create-next-app
package. This ensures you’re always using the most updated version and, consequently, have access to the latest features.
-p 80
parameter in the startup script to ensure your website runs correctly on this port.
START
field is essential for customizing the startup command. If you want to build and start your website on Square Cloud, configure the START
field as follows:
package.json
:
mysite.com
) instead of the default URL https://mysite.squareweb.app/
, you need the Standard plan or higher. The subdomain is defined by the SUBDOMAIN field in the configuration file. See: How to set up your custom domain..env
file.