Skip to content
This repository was archived by the owner on Nov 20, 2025. It is now read-only.

Commit 878609c

Browse files
committed
add setup docs.
1 parent cd863ba commit 878609c

File tree

7 files changed

+163
-14
lines changed

7 files changed

+163
-14
lines changed

.env.example

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@ ALIENOS_WORK_DIR="alienos_wd/"
88

99
# Relay information document (NIP-11)
1010
ALIENOS_RELAY_NAME="Alienos"
11-
ALIENOS_RELAY_ICON=""
12-
ALIENOS_RELAY_BANNER=""
11+
ALIENOS_RELAY_ICON="https://nostr.download/6695de4b095cd99ee7b4f6e2ef9ff89a9029efc1a017e60b8b5b5cb446b2c1e0.webp"
12+
ALIENOS_RELAY_BANNER="https://nostr.download/5b3fa3e40365061d58946fdb1bc6549a4675186591f9f589f9983895bfac8940.webp"
1313
ALIENOS_RELAY_DESCRIPTION="A self-hosting Nostr stack!"
1414
ALIENOS_RELAY_PUBKEY="badbdda507572b397852048ea74f2ef3ad92b1aac07c3d4e1dec174e8cdc962a"
1515
ALIENOS_RELAY_CONTACT="hi@dezh.tech"
1616

17-
# Set a private key here. this would be used to send system notifications to admin (alienos_RELAY_PUBKEY) as DM.
17+
# Set a private key here. this would be used to send system notifications to admin (ALIENOS_RELAY_PUBKEY) as DM.
1818
# Warning: don't use your main key. generate a key only for this purpose.
1919
ALIENOS_RELAY_SELF="b80a9c92d74c5d8067cc7b39e93999ce1c69cd44fa66f46387b863f3a6dc25e0" # not safe! just for example.
2020

2121
# Network
2222
ALIENOS_RELAY_PORT=":7771"
2323
ALIENOS_RELAY_BIND="0.0.0.0"
24-
ALIENOS_RELAY_URL="alienos.jellyfish.land"
24+
ALIENOS_RELAY_URL="nostr.kehiy.net"
2525

2626
# Backup Info
2727
ALIENOS_BACKUP_ENABLE="false"

README.md

Lines changed: 97 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ This project is based on [Khatru](https://github.com/fiatjaf/khatru), [EventStor
2626
- [X] Manageable using NIP-86.
2727
- [X] Landing page with NIP-11 document.
2828
- [X] S3 backups (relay dbs/blobs/nip05 data/management info).
29-
- [ ] Full setup document.
3029
- [ ] Moderator notifications.
3130
- [ ] StartOS support.
3231
- [ ] Umbrel support.
@@ -36,13 +35,106 @@ This project is based on [Khatru](https://github.com/fiatjaf/khatru), [EventStor
3635

3736
### VPS
3837

39-
> TODO.
38+
In this guide we explain how you can run a alienos instance on your VPS using docker and nginx or without docker.
4039

41-
#### Docker
40+
1. Prerequisites:
4241

43-
> TODO.
42+
This project min requirements to be run is as below:
43+
44+
- **CPU**: 0.5 vCore
45+
- **Memory**: 500MB
46+
- **Storage**: Depends on your database size.
47+
48+
You need to by a server form your preferred provider and obtain ssh access to it.
49+
Its recommended to use debian/ubuntu distribution.
50+
51+
2. Domain name (optional): you can buy a domain name from your preferred provider to use for your relay. its recommended to do that.
52+
53+
3. Install Docker and Docker-compose:
54+
55+
```bash
56+
sudo apt update
57+
sudo apt install -y docker.io
58+
sudo apt install -y docker-compose
59+
```
60+
61+
4. Clone this repository:
62+
63+
```bash
64+
git clone https://github.com/dezh-tech/alienos.git
65+
cd alienos
66+
```
67+
68+
5. Setup your config:
69+
70+
```bash
71+
cp .env.example .env
72+
nano .env
73+
```
74+
75+
It would open a file that allows you to edit config file. Each field contains an example and comment as documentation. Make sure you read them.
76+
77+
> [!WARNING]
78+
> Technical note:
79+
> If you chained port config, don't forget to update it on docker-compose.yaml as well.
80+
81+
Use Ctrl+O+Enter and then Ctrl+X to save and exit.
82+
83+
6. Build and run:
84+
85+
Use this command to build and run your image:
86+
87+
```bash
88+
docker-compose up --build -d
89+
```
90+
91+
---
92+
93+
#### Setting up a domain (optional/recommended):
94+
95+
Using this command install nginx:
96+
97+
```bash
98+
sudo apt install nginx
99+
```
100+
101+
Setup your domain:
102+
103+
```bash
104+
sudo nano /etc/nginx/sites-available/<your-domain.com>
105+
```
106+
107+
> Replace it with your domain excluding the < and >.
108+
109+
Paste the [example config](nginx.conf) there and replace your domain.
110+
111+
Use Ctrl+O+Enter and then Ctrl+X to save and exit.
112+
113+
Enable the Nginx config:
114+
115+
```bash
116+
sudo ln -s /etc/nginx/sites-available/<your-domain.com> /etc/nginx/sites-enabled/
117+
```
118+
119+
Restart Nginx:
120+
121+
```bash
122+
sudo systemctl restart nginx
123+
```
124+
125+
Setup SSL (optional/recommended):
126+
127+
```bash
128+
sudo apt install certbot python3-certbot-nginx
129+
sudo certbot --nginx -d <your-domain.com>
130+
```
131+
132+
Then follow the prompts and provide required info to set up the SSL.
133+
134+
135+
Now your alienos server must be available using `wss://you-domain.com` and `wss://youe-ip:port`.
44136

45-
#### OS
137+
### Relay tools
46138

47139
> TODO.
48140

docker-compose.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: '3.8'
2+
3+
services:
4+
alienos:
5+
build: .
6+
env_file: .env
7+
ports:
8+
- "7771:7771"

dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM golang:1.23.3-alpine AS builder
2+
3+
WORKDIR /app
4+
5+
COPY go.mod go.sum ./
6+
7+
RUN go mod download
8+
9+
COPY . .
10+
11+
RUN go build -o alienos --tags libsecp256k1
12+
13+
FROM alpine:latest
14+
15+
COPY --from=builder /app/alienos /usr/local/bin/alienos
16+
17+
EXPOSE 7771
18+
19+
CMD ["alienos"]

nginx.conf

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
server {
2+
listen 80;
3+
server_name <your-domain.com>;
4+
5+
location / {
6+
proxy_pass http://localhost:7771;
7+
proxy_http_version 1.1;
8+
proxy_set_header Upgrade $http_upgrade;
9+
proxy_set_header Connection 'upgrade';
10+
proxy_set_header Host $host;
11+
proxy_cache_bypass $http_upgrade;
12+
}
13+
14+
return 301 https://$host$request_uri;
15+
}
16+
17+
server {
18+
listen 443 ssl;
19+
server_name <your-domain.com>;
20+
21+
ssl_certificate /etc/letsencrypt/live/your-domain.com/fullchain.pem; # Managed by certbot
22+
ssl_certificate_key /etc/letsencrypt/live/your-domain.com/privkey.pem; # Managed by certbot
23+
24+
location / {
25+
proxy_pass http://localhost:7771;
26+
proxy_http_version 1.1;
27+
proxy_set_header Upgrade $http_upgrade;
28+
proxy_set_header Connection 'upgrade';
29+
proxy_set_header Host $host;
30+
proxy_cache_bypass $http_upgrade;
31+
}
32+
}

utils.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
)
88

99
func Mkdir(path string) error {
10-
// create the directory
1110
if err := os.MkdirAll(path, 0o750); err != nil {
1211
return fmt.Errorf("could not create directory %s", path)
1312
}
@@ -20,7 +19,6 @@ func ReadFile(filename string) ([]byte, error) {
2019
}
2120

2221
func WriteFile(filename string, data []byte) error {
23-
// create directory
2422
if err := Mkdir(filepath.Dir(filename)); err != nil {
2523
return err
2624
}

version.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import "fmt"
55
// These constants follow the semantic versioning 2.0.0 spec.
66
// see: http://semver.org
77
var (
8-
major = 0
8+
major = 1
99
minor = 0
10-
patch = 1
11-
meta = "beta"
10+
patch = 0
11+
meta = ""
1212
)
1313

1414
func StringVersion() string {

0 commit comments

Comments
 (0)