> ## Documentation Index
> Fetch the complete documentation index at: https://documentation.bearsampp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Change Service Ports in Bearsampp

> Learn how to view and change the network ports used by Apache, MySQL, MariaDB, PostgreSQL, Mailpit, Memcached, and Xlight in Bearsampp.

Every service in Bearsampp listens on a network port. The default ports follow standard conventions, but you can change any of them from the tray menu — useful when another application on your system is already using the same port.

## Default ports

| Service            | Default port | Notes                                                                     |
| ------------------ | ------------ | ------------------------------------------------------------------------- |
| Apache (HTTP)      | `80`         | Standard HTTP port                                                        |
| Apache (HTTPS/SSL) | `443`        | Standard HTTPS port                                                       |
| MySQL              | `3306`       | Standard MySQL port                                                       |
| MariaDB            | `3307`       | Uses a different port from MySQL to avoid conflicts when both are running |
| PostgreSQL         | `5432`       | Standard PostgreSQL port                                                  |
| Mailpit (SMTP)     | `1025`       | SMTP port for capturing outgoing mail                                     |
| Mailpit (Web UI)   | `8025`       | Browser interface for viewing captured emails                             |
| Memcached          | `11211`      | Standard Memcached port                                                   |
| Xlight (FTP)       | `21`         | Standard FTP port                                                         |

## How to change a port

<Steps>
  <Step title="Right-click the Bearsampp tray icon">
    Find the Bearsampp bear icon in the Windows system tray (bottom-right corner of your taskbar) and right-click it.
  </Step>

  <Step title="Open the service menu">
    Hover over the name of the service whose port you want to change — for example, **Apache**, **MySQL**, or **MariaDB**.
  </Step>

  <Step title="Click Change port">
    In the service submenu, click **Change port**. A dialog box opens showing the current port number.
  </Step>

  <Step title="Enter the new port number">
    Type the new port number in the input field. Port numbers must be between `1` and `65535`. Ports below `1024` require Administrator privileges.
  </Step>

  <Step title="Click Finish">
    Click **Finish** to apply the change. Bearsampp will update the service configuration and restart the service automatically.
  </Step>
</Steps>

<Warning>
  Changing a port requires the service to restart. Any active connections to that service will be interrupted briefly while it restarts.
</Warning>

## Checking whether a port is available

Before assigning a new port, you can verify it is not already in use by another application.

<Steps>
  <Step title="Open the service menu">
    Right-click the tray icon and hover over the service you want to check.
  </Step>

  <Step title="Click Check port">
    In the service submenu, click **Check port \[number]**. Bearsampp will tell you whether the port is free or identify which process is using it.
  </Step>
</Steps>

<Tip>
  Use "Check port" before changing to a new port number to avoid a failed restart caused by a port conflict.
</Tip>

## Port conflict detection

When Bearsampp starts a service, it automatically checks whether the configured port is already in use. If a conflict is detected, Bearsampp will:

1. Show an error message identifying which process is occupying the port.
2. Leave the service stopped rather than forcibly taking the port.

To resolve a conflict, either stop the application using that port or change Bearsampp's service port to a different number.

<Note>
  Windows services such as IIS (Internet Information Services) often occupy port `80` or `443` by default. If Apache fails to start, check whether IIS is running on your system.
</Note>
