1
00:00:03,000 --> 00:00:05,756
In this section we'll see how to publish

2
00:00:05,756 --> 00:00:07,548
our website to production.

3
00:00:07,617 --> 00:00:11,011
There are a few ways to deploy a Next.js app.

4
00:00:11,011 --> 00:00:13,340
We touched on this before, but

5
00:00:13,340 --> 00:00:15,669
if you only have static pages,

6
00:00:15,746 --> 00:00:18,471
like in our Reviews project at the moment,

7
00:00:18,471 --> 00:00:20,992
then you can do a Static Export.

8
00:00:20,992 --> 00:00:23,634
This will give you a folder with all

9
00:00:23,634 --> 00:00:25,835
the HTML and JavaScript files,

10
00:00:25,908 --> 00:00:29,432
that you can then upload to any web server.

11
00:00:29,432 --> 00:00:31,399
It could be your own server,

12
00:00:31,399 --> 00:00:34,877
or any of the myriad of hosting platforms

13
00:00:34,877 --> 00:00:37,337
that support static websites.

14
00:00:37,422 --> 00:00:39,651
So, a Static Export gives you

15
00:00:39,651 --> 00:00:41,496
the greatest flexibility

16
00:00:41,573 --> 00:00:44,678
when it comes to where you can publish your app.

17
00:00:44,678 --> 00:00:47,030
The alternative is to deploy

18
00:00:47,030 --> 00:00:49,215
your full Next.js project,

19
00:00:49,299 --> 00:00:53,014
with all the code running in a Node.js server.

20
00:00:53,014 --> 00:00:55,750
Again, you can set up your own server,

21
00:00:55,750 --> 00:00:58,859
or you can use one of a few platforms

22
00:00:58,859 --> 00:01:00,624
that support Next.js.

23
00:01:00,708 --> 00:01:03,682
Running the full app code is necessary

24
00:01:03,682 --> 00:01:05,923
if you want full-stack features

25
00:01:05,923 --> 00:01:08,092
such as server-side rendering.

26
00:01:08,164 --> 00:01:11,473
But even if you have a purely static website,

27
00:01:11,473 --> 00:01:12,723
like in our case,

28
00:01:12,797 --> 00:01:16,682
using a fully hosted solution like Vercel

29
00:01:16,682 --> 00:01:19,284
could still be the simplest option.

30
00:01:19,284 --> 00:01:22,230
That's why I'll show you this approach first,

31
00:01:22,230 --> 00:01:23,408
in the next video.

32
00:01:23,473 --> 00:01:25,794
If you want greater flexibility,

33
00:01:25,794 --> 00:01:28,651
we'll then see how to do a Static Export,

34
00:01:28,651 --> 00:01:31,304
and also how to upload the output

35
00:01:31,304 --> 00:01:33,072
to a hosting platform.

36
00:01:33,152 --> 00:01:36,445
We'll use Netlify for that, just as an example.

37
00:01:36,445 --> 00:01:38,885
If you want to run your own servers,

38
00:01:38,885 --> 00:01:42,240
that requires some system administration skills,

39
00:01:42,240 --> 00:01:45,361
and that's a bit outside the scope of this course

40
00:01:45,361 --> 00:01:47,431
so I won't show you how to do that,

41
00:01:47,431 --> 00:01:49,969
but I will provide you with an article with

42
00:01:49,969 --> 00:01:52,271
some useful links if you're interested.

