# Pointing Your Domain: Setting Up Nginx Proxy Manager on Ubuntu

So you’ve got your Docker containers running (like the Ghost blog from the last guide), but typing `localhost:8080` or an IP address isn't very professional. To point a real domain name like `www.yourname.com` to your Ubuntu machine and secure it with **HTTPS**, you need a **Reverse Proxy**.

**Nginx Proxy Manager (NPM)** is the gold standard for this because it provides a clean web interface to manage complex server configurations without ever touching a config file.

---

## 1. What is a Reverse Proxy?

Think of a Reverse Proxy as a **receptionist** for your server. When someone types your domain into their browser, they arrive at the receptionist (NPM). The receptionist looks at the name on the request and directs the visitor to the correct "room" (the Docker container) inside your server.

---

## 2. Installing Nginx Proxy Manager

We will use Docker Compose to set this up, just like we did for the blog.

### Step 1: Create the directory

```bash
mkdir nginx-proxy && cd nginx-proxy

```

### Step 2: Create the `docker-compose.yml`

```yaml
version: '3.8'
services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    restart: always
    ports:
      - '80:80'   # HTTP Traffic
      - '81:81'   # Admin Dashboard
      - '443:443' # HTTPS Traffic
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt

```

### Step 3: Launch

`docker compose up -d`

---

## 3. Accessing the Dashboard

Open your browser and go to `http://your-server-ip:81`.

* **Default Email:** `admin@example.com`
* **Default Password:** `saveage`

*Immediately after logging in, Ubuntu will prompt you to update these credentials for security.*

---

## 4. Pointing Your Domain

Before NPM can do its job, you must go to your domain registrar (like Namecheap, Google, or Cloudflare) and create an **A Record**.

* **Type:** A
* **Name:** @ (or your subdomain like 'blog')
* **Value:** Your Ubuntu server's Public IP address.

---

## 5. Creating a Proxy Host (The Magic Step)

Now, back in the NPM Dashboard:

1. Go to **Hosts > Proxy Hosts > Add Proxy Host**.
2. **Domain Names**: Enter `www.yourname.com`.
3. **Scheme**: `http`.
4. **Forward Name/IP**: Use the **Internal IP** of your Docker container (or the server's local IP).
5. **Forward Port**: The internal port of your app (e.g., `2368` for Ghost).
6. **SSL Tab**: Select **Request a new SSL Certificate**. Agree to the terms and click **Save**.

---

## 6. Why This is Better in 2026

In the past, setting up **Let's Encrypt** SSL certificates required manual scripts and cron jobs. NPM handles the "handshake" automatically. If your certificate is about to expire, NPM renews it in the background without you ever knowing. Your users will always see the "Secure" padlock icon in their browser.

---

### Pro Tip: Port Forwarding

If you are running this server from home, you must log into your **Home Router** and "Forward" ports `80` and `443` to your Ubuntu machine's local IP address. Without this, the rest of the internet won't be able to find your receptionist!