Pig LogoPig Docs
Quickstart

Connecting To Pig

Now from the CLI, join your Piglet to a Pig control plane with:

piglet join --secret SK-YOUR-SECRET-KEY

Get your secret API key here

Once joined, you should see logs like:

Display dimensions: 1280x800
Local server running at http://localhost:3000
Connected to control server

And you'll see Piglet's cursor appear on your screen.

This means your machine is connected!

See your Pig Dashboard to view the connected machine and get its Machine ID.

How Piglet Runs Securely:

Piglet runs a localhost server, at http://localhost:3000, exposing APIs for actions like clicking, typing, and taking screenshots. This server is local by default, bound to host 127.0.0.1 and not accessible from the internet.

The join subcommand then tells the Piglet to establish a secure websocket connection to a trusted control server (piglet.pig.dev), which will allow authenticated traffic to proxy to this machine's localhost server. This dial-out strategy is the most secure way to connect, allowing your firewall rules to be as strict as possible.

Disconnect:

Piglet is a simple command line process for now, so disconnecting is as simple as killing the process with Ctrl+C or closing the terminal window.

On this page