Bits Beyond

How to create a next.js application with create-next-app

Cover Image for How to create a next.js application with create-next-app

Prerequisites

To create a next.js application you need to have Node.js installed on your machine. You can download Node.js from the official website here.

Creating a next.js application

The easiest way to create a next.js application is by using the create-next-app command. You can run this command using npx like this:

npx create-next-app

This command will guide you through the process of creating a new next.js application.

If you want you can also run create-next-app non-interactively. Which parameters are available you can run:

create-next-app --help

We will create our next.js application with the following command:

npx create-next-app my-next-js-app --ts --eslint --tailwind --src-dir --app --import-alias '@/*'

Running the next.js application

After you have created the next.js application you can run it using the following command:

cd my-next-js-app
npm run dev

This will start the development server and you can access your next.js application in the browser at http://localhost:3000.

> my-next-js-app@0.1.0 dev
> next dev
 
 Next.js 14.2.5
  - Local:        http://localhost:3000
 
 Starting...
 Ready in 2.1s

Conclusion

Creating a next.js application is very easy using the create-next-app command. You can customize the application by passing different parameters to the command. Read the next post to learn more about how to write your first web application using next.js.

Read Next

Cover Image for How to create a next.js blog application with mdx and static generation

How to create a next.js blog application with mdx and static generation

Explore how to create a next.js blog application with markdown support and static generation at build time.

Cover Image for How to deploy a next.js application on docker hub

How to deploy a next.js application on docker hub

Explore how to deploy a next.js application on docker hub.

Cover Image for How to work with a next.js application

How to work with a next.js application

In this post we will explore how to with a next.js application to add pages, support routing and dynamic routes.