Prepare your laptop

Before ordering anything: the site builds cleanly from scratch, you know what you are about to ship, the project folder (the only original of the site) is backed up, and ssh on your Mac keeps passphrases in the Keychain. The server's SSH key is made on the next page.

beginner~20 min hands-on
#ssh#nextjs#macos#backup#time-machine

Not validated end to end yet — be the first.Report a problem

Draft — not yet run end to end. This page was written but its author has not yet run it on a real machine. Commands may be wrong: read before you run, and tell us what breaks.

The gistYour Mac, the only original
Your Mac
npm run buildbacked updeploy (page 6)
Project folder
Build outputout/
Time Machinetmutil latestbackup
Later: OVH and the server

The project folder is the single source of truth: it builds into out/, which is what the server will get, and a backup must cover it. No SSH key yet: the server's key is made on the next page.

Before you order a server, get your Mac in order. This page makes sure the site builds from nothing, shows you what you are about to ship, checks that the project folder is backed up (it is the only original of the site), and sets ssh on this Mac to keep passphrases in the Keychain. No SSH key is made here: the next page makes one for the server, right before the OVH order form.

Before you start

You need Node 22 with npm. Everything on this page runs in Terminal on your Mac, in the project folder .

Mac
$node -v
$npm -v
Check
$node -v | cut -d. -f1
Expected output
v22

Let macOS remember SSH passphrases

No SSH key on this page: the next page makes one for the server, with a passphrase, right before the order form. What you set now is how this Mac handles that passphrase, so that you type it once and not at every connection. Copy the command and paste it in the terminal: it adds a Host * block at the end of ~/.ssh/config, and creates the file if it does not exist.

Mac
$mkdir -p ~/.ssh && chmod 700 ~/.ssh
$cat >> ~/.ssh/config <<'EOF'
$
$Host *
$ AddKeysToAgent yes
$ UseKeychain yes
$EOF
$chmod 600 ~/.ssh/config
If ~/.ssh/config already has a Host * block

If it already holds AddKeysToAgent yes and UseKeychain yes, do not run the command above: one block is enough. If that block also has a line IdentityFile ~/.ssh/id_ed25519, delete that line: it makes ssh offer that key, whatever it was made for, to every server you connect to. Open the file:

Mac
$vim ~/.ssh/config
Check
$grep -q 'UseKeychain yes' ~/.ssh/config && echo keychain OK
Expected output
keychain OK

Check the build from scratch

A build that works on your machine can depend on a stale node_modules or a leftover .next cache. Remove both, reinstall from the lockfile, and build:

Mac
Sensitive command — recursive or forced deletion (rm). Review before running.
$cd && rm -rf node_modules .next out
$npm ci
$npm run build
Check
$cd  && test -f out/index.html && test -f out/404.html && echo build OK
Expected output
build OK

Know what you ship

out/ is exactly what the server will hold. Look at its size and at the heaviest files in it:

Mac
$du -sh out
$find out -type f -size +20M -exec du -h {} +

These files deploy fine as they are. Nothing to compress or move today:

  • The first deploy (page 6) uploads everything once; a few hundred megabytes take minutes on a home connection.
  • Every later deploy sends only the files that changed, so an unchanged 55 MB WAV costs nothing after the first time.
  • The VPS disk (40 GB on the smallest OVH plan) holds dozens of releases of a site this size.

What those files cost your visitors (a 55 MB download on a phone) is a separate question, handled on the launch checklist (page 8).

Back up the project folder

There is no other copy of this site. The folder holds the only original of the source and of the media; photos-26-og/ holds the only originals of the photos (276 MB of HEIC and MOV). The server will only ever hold built copies, which cannot be turned back into the project.

Time Machine is the simplest backup on a Mac. Check that a destination is set up and when it last ran:

Mac
$tmutil destinationinfo
$tmutil latestbackup

Then make sure the project folder is not excluded (excluding big folders is a common way to save backup space):

Mac
$tmutil isexcluded
Check
$tmutil isexcluded 
Expected output
[Included]

Done

The site builds from an empty folder, you know what out/ weighs and which files make it heavy, the project folder is covered by a backup, and ssh on your Mac keeps passphrases in the Keychain.

Next page: Order the VPS at OVH, where you make the server's SSH key right before the order form, then paste its public half into it.

Did everything work?

If you followed this page to the end on a real machine, say so. Your validation is dated and records your stack, so the next reader on the same path knows it still works.

This copy is read-only. To report that it works, or that it does not, open an issue

Only your stack choices are recorded, never your values. The pseudonym stays on this browser.