From chat to the terminal|INEMA.CLUB-PRO

Lesson 8 · 20 min

Page live and the same project on a VPS

Saving, sending, and putting it online are three steps and three decisions. With an SSH key and gh, you send the project to GitHub, publish the page at an address that opens on your phone, and bring the same folder to a VPS, where the agent works even when your computer is off.

Start the lesson
Laptop with the terminal open and a phone beside it showing a published page; servers in the background.

In this lesson, you will

  1. 1Create the SSH key and share only the public key
  2. 2Create the repository, publish on Pages, and follow the push routine
  3. 3Check the destination, status, versions, and secrets before sending
  4. 4Log in to the VPS, clone the project, and get the latest changes

Objective: connect the terminal to GitHub with an SSH key, publish the page on GitHub Pages, and clone the project to a VPS.

01Three places, one project

GitHub is the bridge between your computer, the page, and the VPS.

Scroll down: each step below lights up its part of the diagram.

  1. 1/5

    Your computer

    The private key never leaves here. The commit saves the version only on your computer; nothing goes online until you decide to send it.

  2. 2/5

    GitHub

    The push sends the versions. Public repository: anyone can see it (and that’s required for the free page). Private: only you and the people you invite. You choose when you create it.

  3. 3/5

    GitHub Pages

    Putting it online is one more step. Once Pages is turned on, each push updates the page in a few minutes, at an address that opens on your phone.

  4. 4/5

    VPS

    A rented room: the provider supplies the machine; users, updates, and programs are up to you. You log in with ssh, navigate using Linux names, and get the project from GitHub.

  5. 5/5

    Save, send, put online

    The commit stays on your computer, the push takes it to GitHub, and Pages puts it online. The VPS gets the same version with git pull. Each step is your decision, with its own check.

The public key (.pub) is the padlock: it goes to GitHub and the VPS. The private key is the key on your key ring: it stays with you.

02From commit to published page

Click each step.

1. SSH key

ssh-keygen comes with Windows 10 and 11. It asks three questions: where to save the key and for an extra password, twice. Pressing Enter three times works for practice.

Two files go in %USERPROFILE%\.ssh: id_ed25519 (private, never leaves there) and id_ed25519.pub (public).

Asked Overwrite?You already have a key: answer n and use the existing one.

03The commands, in order

Replace Seu Nome, seu@email.com, SEU-USUARIO, and IP-DA-VPS with your own.

cmd · who you are in Git (for all projects)
git config --global user.name "Seu Nome"
git config --global user.email "seu@email.com"
git config --global --list
cmd · the SSH key
ssh-keygen -t ed25519 -C "seu@email.com"
explorer %USERPROFILE%\.ssh
cmd · connect gh to your account
gh auth login
ssh -T git@github.com
cmd · create the repository and send it
cd %USERPROFILE%\projetos\meu-primeiro-agente
git status
git branch -M main
gh repo create meu-primeiro-agente --public --source=. --push
cmd · turn on GitHub Pages
gh api repos/{owner}/{repo}/pages -X POST -f "source[branch]=main" -f "source[path]=/"
cmd · the daily routine
git status
git add .
git commit -m "o que mudou"
git push
VPS (Linux) · connect, clone, and update
ssh root@IP-DA-VPS
mkdir -p ~/projetos
cd ~/projetos
apt update && apt install -y git
git clone https://github.com/SEU-USUARIO/meu-primeiro-agente.git
cd meu-primeiro-agente
ls
git pull
exit
VPS (Linux) · the agent on the server
curl -fsSL https://claude.ai/install.sh | bash
cd ~/projetos/meu-primeiro-agente
claude
Simulation: illustrative example
C:\Users\ana> ssh -T git@github.com
Hi ana-exemplo! You've successfully authenticated, but GitHub does not provide shell access.
C:\Users\ana\projetos\meu-primeiro-agente> gh repo create meu-primeiro-agente --public --source=. --push
✓ Created repository ana-exemplo/meu-primeiro-agente on GitHub

A few minutes after turning on Pages, the page opens at https://ana-exemplo.github.io/meu-primeiro-agente/.

04Rehearse: the project on the VPS

Same navigation, different names. Check the start of the line.

Missions

  1. 1Connect to the VPS as root (the example IP is 203.0.113.10).
  2. 2Ask where you are (on Linux, use pwd).
  3. 3Create the projects folder (mkdir -p ~/projetos).
  4. 4Go into it.
  5. 5Bring in the project from GitHub (user ana-exemplo).
  6. 6Go into the folder and list its contents (two commands: start with cd).
  7. 7List what came in (on Linux, use ls).
  8. 8You changed something on Windows and pushed it. Bring in the change.
  9. 9Exit the VPS.
VPS Ubuntu · simulation

Simulation: the IP, username, and codes are examples (203.0.113.10 is an address reserved for documentation).

05Practice

The live page is required; the VPS is optional until you have one.

E15 · Key on the keyring

15 min

Create the SSH key, run gh auth login and choose SSH, then test with ssh -T git@github.com.

Done when: The reply starts with "Hi" followed by your GitHub username.

E16 · Live page

20 min

Check the four points, create a public repository, turn on Pages, then make a change and run the add, commit, and push routine.

Done when: The page opens on your phone at https://SEU-USUARIO.github.io/meu-primeiro-agente/ and the change appears after the push.

E17 · The same project on the VPS

30 min

On an Ubuntu VPS set up with your public key, connect with ssh, clone the project, make a change on Windows, push it, and bring it over with git pull.

Done when: ls on the VPS shows the files, and git pull brought in the change made on Windows.

06The whole step, command by command

From an empty terminal on Windows to a site on GitHub Pages and the project running on the VPS.

The manager who masters the terminal: OSWork, command by command · 7 min 46 secVideo page with script →

07Generate your plan with dates

Choose a start date and how much time you have each week. The plan spreads out the course's 17 exercises.

08Step 1 in four sentences

Know where you areBefore any command, check the path before >. The wrong folder can look like an AI failure.
Folder with rulesOne topic per folder, README for people, AGENTS.md with rules you can check.
Safety netKeep secrets in .env and out of Git; commit before a big change; restore if you don't like it.
You decideSaving, sending, and putting it online are three steps. The agent does the work; you check and approve it.

09Final test

About this lesson and the whole step.

Question 1 of 4

Someone asked for your SSH key to "set up access." Which file can you give them?competency

Next steps