Skip to main content

Configure P2P

Last updated on August 3, 2026

Introduction

This article shows the P2P-specific backend setup required before Matchmaking can create a player-hosted game session. Use this page only after you have chosen P2P as the hosting model in Matchmaking.

For the complete Matchmaking setup path, including rulesets, match pools, and game-code integration, see Introduction to Matchmaking.

Prerequisites

Before configuring P2P, make sure you have:

  • An AGS game namespace.
  • Access to the Admin Portal for the game namespace where you will configure Session.
  • TURN server regions available for your environment. For additional regions, contact AccelByte or submit a ticket from the TURN server configuration page.

Create a P2P session template

Follow the steps in Configure session templates to create a Session V2 game session template.

When creating the template, set Session Type to P2P.

Setting the session type to P2P

Expected result: the session template appears in the Session templates list and can be selected by a match pool.

How P2P Host Selection Works

After Matchmaking creates a game session from the P2P session template:

  1. Lobby sends a game session invitation to each matched member.
  2. Each member joins the game session.
  3. The first member that joins becomes the game session leader and P2P host.
  4. Other members read the game session leader ID and start as clients targeting that host.
  5. The networking library performs signaling through Lobby, ICE candidate exchange, STUN checks, and TURN relay fallback when a direct connection is not available.
info

The game session leader is the host for the P2P session. If your game needs host migration or recovery when the host leaves during gameplay, design that behavior in your game layer and test it explicitly.

Continue Setup

After creating the P2P session template:

  1. Configure your match ruleset.
  2. Configure your match pool and select the P2P session template.
  3. Set up P2P transport for your engine:
  4. Follow the shared Matchmaking game-code guide: