# Use your own server > How to add a machine you already have, what the install command does and how to keep the agent up to date. You don't need to connect a cloud to use the panel. A machine you already have (a VPS, a droplet, an EC2 instance or a physical server) can be added directly in **Servers**. You run a command on it, the agent is installed, and the machine starts receiving deploys like any other server. ## Requirements - **Operating system**: Ubuntu or Debian. - **Architecture**: x86_64 (amd64). The agent image is x86; ARM machines aren't supported. - **Root access**: the command runs with `sudo`. - **Ports 80 and 443** open to the internet, if you'll use domains. HTTPS is issued by Let's Encrypt, which needs to reach the machine on port 80. - **Outbound internet access**: the agent connects to the panel API over HTTPS and Docker pulls images. No inbound port needs to be opened for the agent. > [!TIP] > Use a dedicated machine. The agent manages the machine's Docker containers, and the server terminal gives root access. ## Add the server 1. Open **Servers** and click **New server**. 2. In **Where to create**, pick **My own server**. 3. Enter a **Name**, for example `app-1`. 4. Click **Add**. The panel shows the install command, with a token unique to this server. ![Install command for your own server](https://ployter.com/assets/docs/en/own-server-install-command.webp) > [!WARNING] > The token is shown only now. Copy the command before closing. Lost it? Generate another on the server screen, in **Actions → New install command**. ## Run the command SSH into the machine and run the copied command as root. It has this format: ```bash curl -fsSL https://api.ployter.com/agent/install.sh | sudo bash -s -- https://api.ployter.com ``` The address and token come filled in on the command the panel shows. Always use the command copied from the panel. Within 1 to 2 minutes the server shows as **Online**. Until the agent connects, the server screen shows **The agent has not connected yet**. ## What the command does The install script: 1. Installs Docker, if it isn't on the machine yet. 2. Sets up Docker log rotation (10 MB per file, 5 files) in `/etc/docker/daemon.json`, so a verbose service doesn't fill the disk. If this file already exists, it isn't changed: the script only warns you. 3. Creates swap if the machine has less than 8 GB of RAM and no swap yet: 4 GB, or 2 GB if the disk has less than 30 GB free. Swap keeps a heavy build from taking down another service for lack of memory. 4. Sets `vm.overcommit_memory = 1`, so Redis can save in the background with little free memory. 5. Starts the `infra-agent` container, with automatic restart. The agent runs with: - access to the Docker socket, to create and stop the services' containers; - the machine's root mounted read-only, to measure the disk; - host networking, to see the real IP and hostname; - high memory priority, so the system kills another process before it when memory runs out. Running the command again is safe: it replaces the agent container with the current version. ## What the agent does Once connected, the agent: - builds (Dockerfile or Railpack) and deploys the services; - routes domains and issues HTTPS certificates; - sends machine and container metrics, logs and requests; - opens the terminal, volume files and SFTP when you ask; - runs backups and scheduled tasks. The connection always goes from inside out, from the machine to the panel API. If the network drops, the agent reconnects by itself. If the panel loses contact, the server shows as **Offline**, and the services keep running. ## Firewall On your own server, the panel doesn't control the machine's firewall or your provider's: - Open ports 80 and 443 for domains. - If you turn on a public port on a service (for example, a database reachable from outside) or SFTP, open that port yourself. On machines the panel creates on AWS or DigitalOcean, this is automatic. See [Private network and firewall](https://ployter.com/en/docs/servers/networking/). ## Update the agent When a new agent version comes out, the server screen shows **Agent v... available** with the **Update agent** button. In **Servers**, a notice lists the outdated servers and offers **Update the N agents** at once. The update replaces the agent container with the new image and waits for it to connect to the API. If the new agent doesn't connect within 90 seconds, the old one runs again. Services stay up during the switch. If the platform has automatic updates turned on, the list shows **Automatic update is on**, and agents update themselves when a new version comes out. > [!NOTE] > Very old agents (below v0.4.0) don't update through the panel. The screen shows *"This version does not update itself yet: update it once directly on the server"*. Generate a new command in **Actions → New install command** and run it on the machine. ## Replace the token In **Actions → New install command**, click **Generate new token**. The current token stops working immediately: the agent disconnects and only comes back after you run the new command on the server. Services keep running; only the panel loses contact until then. ## Remove the server In **Actions → Delete server**, the server is removed from the panel and the agent is disconnected. The machine stays on, with whatever containers are on it: shut it down or delete it at your provider. Before that, move or delete the server's services; while it has services, the panel won't let you delete it. ## Limits Like Hetzner, Vultr and Linode, your own server has no panel load balancer: each service runs on a single server. Replicas and autoscaling need servers on AWS or DigitalOcean. See [Replicas and load balancer](https://ployter.com/en/docs/scaling/replicas/).