Skip to content

Commit ec9b9d2

Browse files
authored
Document custom domain for users (#26)
* Document custom domain for users * Add schema on how the ipv4 custom domain work * add to menu * improve doc * Link Custom domain and port forwarding from the instance doc * Remove docs/public/version.json docs/.vitepress/version.json from git as they are auto generated and cause conflict
1 parent a3a3e15 commit ec9b9d2

File tree

11 files changed

+194
-21
lines changed

11 files changed

+194
-21
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ docs/.vitepress/cache
55
# Helper files
66
docs/tools/broken-links.md
77
docs/tools/test-components.md
8+
docs/public/version.json
9+
docs/.vitepress/version.json
10+
811

912
# Node.js dependencies
1013
node_modules

docs/.vitepress/config.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ export default defineConfig({
286286
collapsed: false,
287287
items: [
288288
{ text: 'Custom Domains', link: '/devhub/deploying-and-hosting/custom-domains/setup' },
289+
{text: 'Instance Custom Domains', link: '/devhub/deploying-and-hosting/custom-domains/instance'},
289290
{ text: 'Web Hosting', link: '/devhub/deploying-and-hosting/web-hosting/' },
290291
{ text: 'Ipv4 Port forwarding', link: 'devhub/deploying-and-hosting/ipv4/ipv4-port-forwarding' },
291292
]

docs/.vitepress/version.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

docs/devhub/compute-resources/standard-instances/index.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,15 @@ ssh <user>@<ip> [-i <path-to-ssh-key>]
5252

5353
---
5454

55-
For more details, see the [CLI Reference](/devhub/sdks-and-tools/aleph-cli/).
55+
For more details, see the [CLI Reference](/devhub/sdks-and-tools/aleph-cli/).
56+
57+
58+
### Network
59+
Instance support both IPv4 and IPv6.
60+
61+
They receive a public IPv6 address and an internal IPv4 address.
62+
63+
It is possible to make the VM reachable from the outside on IPv4 using the [Custom Domain](/deploying-and-hosting/custom-domains/instance.md) and/or the [Port Fowarding](deploying-and-hosting/ipv4/ipv4-port-forwarding.md) features.
64+
65+
* Custom domain allows redirecting of http(s) traffic on the standard 80 and 443 ports.
66+
* Port forwarding exposes any chosen VM port on an external port of the host.
233 KB
Loading
94.4 KB
Loading
330 KB
Loading
Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
# Custom Domain for Aleph Cloud Instance
2+
3+
You can use Aleph Cloud Custom Domain Service to automatically handle a Domain Name for your instance.
4+
5+
It not only ensures that the domain name is automatically linked to the DNS of your running VM but also provide transparent routing of webtraffic on IPv4.
6+
7+
The Custom domain feature supports both IPv6 and IPv4, but they works in different way
8+
9+
On IPv6 the custom domain will map directly to the publicly assigned address
10+
On IPv4, the instance receives no public address, thus the ip point to the hosting Compute Resource Node and can be
11+
used in two ways:
12+
13+
* For HTTP, HTTPS (port 80 and 443). Request get automatically redirected to your instance via HAProxy, making it
14+
seamless for your users to connect to web server running instance your instance.
15+
* For other ports. We offer a port forwarding feature that allows routing port from inside your VM to a public port on
16+
the host. See [](../ipv4/ipv4-port-forwarding.md)
17+
18+
# Configuration
19+
20+
Setting up a custom domain for your decentralized instance with Aleph Cloud can be achieved with just a few steps,
21+
either through the CLI or the [Aleph Cloud Console](https://app.aleph.cloud) or manually by updating the aggregate. All
22+
methods will require an initial manual DNS configuration.
23+
24+
## Prerequisites
25+
26+
Before you start, make sure you have:
27+
28+
- Access to your domain's DNS settings.
29+
- The Ethereum address you used to create the instance.
30+
31+
## From the Aleph Cloud Console
32+
33+
A custom domain name can be set upon instance creation, inside the Advanced Configuration Options section
34+
35+
![Add custom domain at creation screenshot](Add%20custom%20domain%20at%20creation.png)
36+
37+
38+
If you want to add a domain to an existing Instance, you can do so via the Settings -> Domains -> Create Custom
39+
domain.
40+
There you can enter your domain name, then in the _Compute_ tab select your instance. The rest of the procedure is the
41+
same.
42+
43+
Then go to the detail page of your instances and follow the instruction on how to configure your DNS Zone properly.
44+
45+
![Custom domain pane](Custom%20domain%20pane.png)
46+
47+
48+
49+
If the domain is correctly set up, it will then display: **Properly configured**
50+
![Custom domain configured screenshot](Custom%20domain%20configured.png)
51+
52+
Note that due to multiple distributed layers of DNS caching, it may takes several hours for your new domain name to be
53+
available everywhere.
54+
55+
## Test that the domain name is correct by
56+
57+
On Unix system, you can check using the dig command:
58+
59+
```
60+
dig AAAA <yourdomain>
61+
```
62+
63+
or doing a ping.
64+
65+
```bash
66+
ping -6 <yourdomain>
67+
```
68+
69+
For IPv4
70+
```bash
71+
ping -6 <yourdomain>
72+
```
73+
74+
## via the CLI
75+
76+
- The [aleph-client](https://github.com/aleph-im/aleph-client/) command-line tool is required.<br>
77+
- See [CLI Reference](/devhub/sdks-and-tools/aleph-cli/) or use `--help` for a quick overview of a specific command.
78+
79+
All the domain commands are in the [`aleph domain` command subgroup](https://docs.aleph.cloud/devhub/sdks-and-tools/aleph-cli/commands/domain.html).
80+
81+
The `aleph domain add` offer an interactive assistant that will guide you on the process of how to set up the instance name.
82+
83+
You can also do each step manually
84+
85+
## Manual DNS Setup
86+
87+
Adding a custom domain to your Aleph Cloud instance involves:
88+
89+
1. Attach the domain in your instance
90+
2. Creating a CNAME record.
91+
3. Creating a TXT owner proof record.
92+
4. Testing the domain setup.
93+
94+
95+
## Step 1: Attach the domain
96+
Use the command `aleph domain attach` or modify the `domain` key of your AGGREGATE.
97+
```bash
98+
aleph domain attach
99+
```
100+
101+
Example aggregate
102+
```json
103+
{
104+
"domains": {
105+
"aleph1.yourdomain.com": {
106+
"type": "instance",
107+
"message_id": "ae1b726cad739ff13e4aea05fd035359e65429615d9223fd69fcc3d48e02a639",
108+
"updated_at": "2025-07-07T14:50:00.562Z",
109+
"programType": "instance"
110+
}
111+
}
112+
}
113+
```
114+
115+
## Step 2: Create a CNAME Record
116+
117+
To add a custom domain, first, you need to create a CNAME record in your domain's DNS settings. The CNAME record will
118+
point your domain to your instance on Aleph Cloud.
119+
120+
1. **Log into your domain provider's site.**
121+
2. **Navigate to your domain's DNS settings.** These settings are usually located in your domain control panel.
122+
3. **Create a new CNAME record.**
123+
- For the `Name/Host/Alias` field, enter your domain (i.e., `<<userdomain.com>>`).
124+
- For the `Value/Answer/Destination` field, enter `program.public.aleph.sh`.
125+
126+
Your CNAME record should look something like this:
127+
128+
NAME: <<userdomain.com>>
129+
VALUE: instance.public.aleph.sh
130+
131+
Save your changes before moving on to the next step.
132+
133+
## Step 3. Create a TXT Owner Proof Record
134+
135+
Next, you need to create a TXT owner proof record in your domain's DNS settings. This record confirms that you own the
136+
domain associated with the Aleph Cloud instance.
137+
138+
1. **Still in your domain's DNS settings, create a new TXT record.**
139+
- For the `Name/Host/Alias` field, enter `_control.<<userdomain.com>>`.
140+
- For the `Value/Answer/Destination` field, enter your Ethereum address (i.e., `<<public address>>`).
141+
142+
Your TXT owner proof record should look something like this:
143+
144+
NAME: _control.<<userdomain.com>>
145+
VALUE: <<public address>>
146+
147+
Save your changes before moving on to the next step.
148+
149+
## Step 4: Test the Domain Setup
150+
151+
Check that you can ping the domain
152+
153+
154+
# Transparent IPv4 forwarding of HTTP and HTTPS
155+
156+
On IPv4 HTTP traffic on both port 80 and 443 will be redirected from your domain name to your instance if you have a webserver running inside it and listening to it's outward ipv4 address.
157+
158+
This is feature use [HaProxy](https://www.haproxy.com/) to listen on the CRN public IPv4 IP and detect which domain name is used and redirect the request to the appropriate instance.
159+
160+
![Schema on how connection works work](schema%20custom%20domain%20instance.png)
161+
162+
This functionality requires a CRN running aleph-vm version 1.7.0 or and higher and a manual setup from the Node operator. All
163+
164+
You can test this is working inside your instance on http by launching a small webserver in python
165+
```bash
166+
sudo python -m http.server 80
167+
```
168+
169+
::: warning
170+
Run this command in a new folder as it will expose all the file in the current folder on the internet.
171+
:::
172+
173+
Then open in your browser http://yourdomain.com.
174+
175+
If it works, then process to install a proper webserver to handle https:// for example Caddy or Nginx and run your intented application inside the VM.
35.6 KB
Loading

docs/devhub/deploying-and-hosting/custom-domains/setup.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Adding a Custom Domain to Your Aleph Cloud Instance and Program
1+
# Adding a Custom Domain to Your Aleph Cloud Function
22

3-
Setting up a custom domain for your decentralized instance or program with Aleph Cloud can be accomplished with just a few steps. Please carefully follow this guide to ensure a smooth process.
3+
Setting up a custom domain for your decentralized function (program) with Aleph Cloud can be achieved with just a few steps. Please carefully follow this guide to ensure a smooth process.
44

55
## Overview
66

7-
Adding a custom domain to your Aleph Cloud instance involves:
7+
Adding a custom domain to your Aleph Cloud program involves:
88

99
1. Creating a CNAME record.
1010
2. Creating a TXT owner proof record.
@@ -63,8 +63,3 @@ After you've set up the DNS records, you can go to the domain detail page to che
6363
3. **Verify that all checks are successful.**
6464

6565

66-
67-
## Note for Instance
68-
Instances are assigned public IPv6 addresses, the custom domain will directly point to that ip.
69-
The ipv4 will resolve to the hosting Computing Resource Node public ipv4 address. To use it at the moment you will need to configure the ipv4 port forwarding, refer to the corresponding section.
70-
[ipv4-port-forwarding.md](../ipv4/ipv4-port-forwarding.md)

0 commit comments

Comments
 (0)