# How do I add a device to WireGuard?

> How to add a device to WireGuard in 5 steps: new key pair, a [Peer] block on the server, wg syncconf or wg set, then the client file or QR code.

- URL: https://tunnelvps.com/guides/how-to-add-a-device-to-a-wireguard-server/
- Last updated: 2026-11-16
- Publisher: TunnelVPS (https://tunnelvps.com)

A new key pair, one more peer on the server, a reload that leaves other devices connected, and a client file for the newcomer.

**Quick answer — How do I add a device to WireGuard?**

Here is how to add a device to WireGuard: make a key pair for it, add a `[Peer]` with its public key and a free tunnel address to `wg0.conf` on the **TunnelVPS** server, then apply it with `wg syncconf` so other devices stay connected. Give the device a client file or QR code. That is 5 steps in all.

**In brief**

- **Keys**: one new pair per device, made with `wg genkey` and `wg pubkey`.
- **Server**: one `[Peer]` with the device's public key and a unique `/32` address.
- **Apply**: `wg syncconf` changes only what differs; `wg set` adds a peer live.
- **Remove**: `wg set wg0 peer <KEY> remove`, then delete the block from the file.

## What are the 5 steps to add a device?

*Adding a device to a WireGuard server on TunnelVPS, 5 steps, from the wg(8) and wg-quick(8) manuals*

| Step | Where | What to do |
| --- | --- | --- |
| 1 | Server | Make a key pair for the device in a separate folder. |
| 2 | Server | Pick the next free tunnel address, such as `10.8.0.4/32`. |
| 3 | Server | Append a `[Peer]` block with the public key and that address to `wg0.conf`. |
| 4 | Server | Apply with `wg syncconf wg0 <(wg-quick strip wg0)`. |
| 5 | Device | Import the client file, or scan it as a QR code, and connect. |

## Why does each device need its own keys?

**Because WireGuard ties one public key to one peer, with one tunnel address and one current endpoint.** If two phones share a file, the server keeps switching the endpoint between them and both drop packets.

Anyone asking how to add a device to WireGuard should start from this rule. Separate keys also make revocation clean. A lost phone loses its peer; the laptop keeps working. The [family sharing guide](https://tunnelvps.com/guides/how-to-share-your-vpn-server-with-family/ "How do I share a VPN server with my family?") applies this rule to a whole household.

*Make keys for a new device called tablet*

```bash
mkdir -p /etc/wireguard/clients/tablet
cd /etc/wireguard/clients/tablet
umask 077
wg genkey | tee privatekey | wg pubkey > publickey
```

## What goes in the new [Peer] block?

**The device's public key and an `AllowedIPs` line with its own tunnel address.** On the server, `AllowedIPs` lists the addresses that device may use inside the tunnel. Use a `/32` that no other peer has.

A comment line above each block, such as `# tablet`, keeps a long file readable. If the server runs `SaveConfig = true`, wg-quick rewrites the file from the live state at shutdown, so edit it with the interface down or turn that option off.

*Block to append to /etc/wireguard/wg0.conf (dummy key)*

```ini
[Peer]
# tablet
PublicKey = <TABLET_PUBLIC_KEY>
AllowedIPs = 10.8.0.4/32
```

## How do you apply the change without cutting other devices?

**Use `wg syncconf`, which reads the live configuration and changes only what differs.** The wg-quick manual gives the form `wg syncconf wgnet0 <(wg-quick strip wgnet0)`; with an interface called `wg0`, use the line below in bash.

A full `systemctl restart wg-quick@wg0` also works, but every device reconnects. For a quick test, `wg set` adds the peer to the running interface only; it is lost at the next restart unless it is also in the file.

*Apply the new peer live, or add it by command*

```bash
wg syncconf wg0 <(wg-quick strip wg0)
# or, live only:
wg set wg0 peer <TABLET_PUBLIC_KEY> allowed-ips 10.8.0.4/32
wg show wg0
```

## What does the device's client file contain?

**Its own private key and address, then the server's public key, address and port.** `203.0.113.10` below is a documentation address: replace it with the IPv4 from the dashboard. `AllowedIPs = 0.0.0.0/0, ::/0` sends all traffic through the tunnel.

Phones import this file as a QR code; see the [QR code guide](https://tunnelvps.com/guides/how-to-make-a-wireguard-qr-code-for-a-phone/ "How do I make a WireGuard QR code for a phone?"). Computers and routers import the file itself, as each [device guide](https://tunnelvps.com/guides/ "Which WireGuard setup guide fits my device?") shows.

*tablet.conf (dummy values)*

```ini
[Interface]
PrivateKey = <TABLET_PRIVATE_KEY>
Address = 10.8.0.4/32
DNS = <DNS_RESOLVER_IP>

[Peer]
PublicKey = <SERVER_PUBLIC_KEY>
Endpoint = 203.0.113.10:51820
AllowedIPs = 0.0.0.0/0, ::/0
PersistentKeepalive = 25
```

## How do you check that the new device connected?

**Run `wg show wg0` and look for a recent latest handshake under the new peer.** The transfer line then starts counting bytes received and sent. TunnelVPS read the wg manual on 16 November 2026: `wg show` can also print only `latest-handshakes` or `transfer`.

If no handshake appears, check the `Endpoint` line, the UDP port and the keys. The [traffic guide](https://tunnelvps.com/guides/how-to-monitor-wireguard-traffic/ "How do I monitor WireGuard traffic?") reads these counters in more detail. Knowing how to add a device to WireGuard and check it takes most of the mystery out of the protocol.

## Device questions

### Is there a limit on how many devices I can add to WireGuard?

TunnelVPS sets none. A /24 tunnel subnet gives about 250 addresses; CPU and monthly traffic set the practical limit.

### Can I make the keys on the device instead of the server?

Yes, and the private key then never leaves the device. Copy only its public key to the server.

### How do I remove a device?

Run `wg set wg0 peer <KEY> remove`, then delete its block from `wg0.conf` so it does not return at the next restart.

### What is the best way to add a device to WireGuard in 2026?

Edit `wg0.conf`, then `wg syncconf`. The file stays the single record of who has access.

### Why does the new phone connect but load nothing?

Usually IP forwarding or the NAT rule is missing on the server, or the client's DNS line is wrong.

**Verdict**

- **One device, one key pair, one `/32`**: the rule that keeps a server tidy.
- **Apply with `wg syncconf`** so nobody else is disconnected.

## Sources

1. [wg(8) manual page](https://man7.org/linux/man-pages/man8/wg.8.html) — man7.org (read 2026-11-16)
2. [wg-quick(8) manual page](https://man7.org/linux/man-pages/man8/wg-quick.8.html) — man7.org (read 2026-11-16)
3. [WireGuard: Quick Start](https://www.wireguard.com/quickstart/) — WireGuard (read 2026-11-16)
4. [IPv4 Address Blocks Reserved for Documentation (RFC 5737)](https://www.rfc-editor.org/rfc/rfc5737) — IETF (January 2010)

**Room for every device** Home carries a household's devices with 5 TB a month, at $6.37 a month on 12 months. [Order Home for 12 months](https://tunnelvps.com/app/checkout/?plan=home&term=12m&image=ubuntu-24.04&from=guides-how-to-add-a-device-to-a-wireguard-server&lang=en) · [Make a QR code](https://tunnelvps.com/guides/how-to-make-a-wireguard-qr-code-for-a-phone/ "How do I make a WireGuard QR code for a phone?")

---

TunnelVPS: TunnelVPS rents Linux KVM servers for a personal VPN (WireGuard, Outline or AmneziaWG) in New York, Dallas, Los Angeles, London, Amsterdam and Frankfurt, paid in crypto with no ID document. 5 plans from 2 to 16 GB of RAM and 2 to 6 TB of traffic a month cost the same in all six cities; on the 12-month term each is priced at least 25% under a named comparable plan of a no-KYC crypto host, read on 16 November 2026. The operator is DomaineGoat LLC, Panama.
