Get started

Create your first computer

Create a computer, run a web server on it, and open it over HTTPS

You will create a computer, run a small web server on it and open that server in your browser over HTTPS. You use the same CLI as the quickstart.

Prerequisites

You need:

  • The nevia CLI, installed and signed in as in the Quickstart.
  • A selected workspace where you have the admin or editor role.

Check the workspace:

nevia workspace current

Create a computer

Create a computer named hello. It publishes port 8080 on HTTPS port 443 and the command waits until the computer is ready:

nevia new hello -p 443:8080 --wait

Check its state and URL:

nevia status hello

The computer should be ready and show a url that looks like https://<host>. Copy it. The URL is set when the computer first becomes ready and never changes.

Default image

Omit --image. The computer starts from the platform default image.

Run a web server

Write a page to the home directory of the nevia user:

nevia exec hello -- sh -c 'echo "<h1>Hello from Nevia</h1>" > ~/index.html'

Start a Python web server on port 8080 in the background. nohup and the redirects keep it running after the exec session ends:

nevia exec hello -- sh -c 'nohup python3 -m http.server 8080 --directory ~ >/dev/null 2>&1 &'

The command returns right away and the server keeps running inside the computer.

Open the URL

Request the url you copied in step 1. Replace <host> with your URL:

curl https://<host>

You should see:

<h1>Hello from Nevia</h1>

Your browser shows the same page. The URL stays the same for as long as the computer exists. Until something listens on port 8080, it returns 503.

Computer ports and URLs covers how mappings and URLs work.

Clean up

Delete the computer and wait until it is gone:

nevia rm hello --yes --wait

Check that hello no longer appears:

nevia ls

Next steps

On this page