Skip to content

Commit 762dc13

Browse files
committed
chore(self-hosting): refactor
1 parent 4eed122 commit 762dc13

File tree

8 files changed

+597
-115
lines changed

8 files changed

+597
-115
lines changed
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
---
2+
title: 'Behind Apache'
3+
description: 'Run NocoDB Behind Apache.'
4+
tags: ['nginx', 'proxy']
5+
keywords : ['NocoDB Apache', 'NocoDB Proxy']
6+
---
7+
import { Tab, Tabs } from 'fumadocs-ui/components/tabs';
8+
9+
## Prerequisites
10+
We assume you already have a Apache server running.
11+
12+
## Step 1 - Run NocoDB
13+
14+
<Tabs items={['docker', 'docker-compose', 'nix']}>
15+
<Tab value="docker">
16+
```bash
17+
docker run \
18+
-d \
19+
--name nocodb \
20+
--tmpfs /run:nodev,nosuid,exec,mode=0755 \
21+
-v ./nocodb:/usr/app/data \
22+
-e NC_AUTH_JWT_SECRET="your-super-secret-string" \
23+
-e NC_PUBLIC_URL="__your_nocodb_domain__.com" \
24+
-p 8080:8080 \
25+
--restart unless-stopped \
26+
-it nocodb/nocodb:latest
27+
```
28+
</Tab>
29+
30+
<Tab value="docker-compose">
31+
```yaml
32+
version: "3.9"
33+
services:
34+
nocodb:
35+
container_name: nocodb
36+
image: nocodb/nocodb:latest
37+
environment:
38+
NC_AUTH_JWT_SECRET: 'your-super-secret-passs'
39+
NC_PUBLIC_URL: '__your_nocodb_domain__.com'
40+
ports:
41+
- "8080:8080"
42+
volumes:
43+
- nocodb_data:/usr/app/data
44+
tmpfs:
45+
- /run:nodev,nosuid,exec,mode=0755
46+
volumes:
47+
nocodb_data:
48+
```
49+
</Tab>
50+
51+
<Tab value="nix">
52+
```bash
53+
nix run github:nocodb/nocodb/master
54+
```
55+
</Tab>
56+
</Tabs>
57+
58+
## Step 2 - Enable the required Apache modules
59+
60+
The Apache config shown later needs the following modules enabled.
61+
62+
```bash
63+
sudo a2enmod proxy headers proxy_http proxy_wstunnel rewrite
64+
sudo systemctl restart apache2
65+
```
66+
67+
## Step 3 - Create the Apache config for NocoDB
68+
69+
Create a new `nocodb.conf` in `/etc/apache2/sites-enabled/` like the following example
70+
71+
> Make sure to replace any __nocodb_domain__ with you own domain
72+
73+
```
74+
<VirtualHost *:80>
75+
ProxyPreserveHost On
76+
77+
# Replace with your domain
78+
ServerName __nocodb_domain__
79+
80+
ProxyPass / http://localhost:8080/
81+
ProxyPassReverse / http://localhost:8080/
82+
83+
</VirtualHost>
84+
85+
```
86+
87+
## Step 3 - Enable the apache site
88+
89+
```bash
90+
sudo a2ensite nocodb.conf
91+
```
92+
93+
You should now be able to access NocoDB on you configured domain.

content/self-hosting/installation/docker-compose.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ services:
3030
ports:
3131
- "80:8080"
3232
volumes:
33-
- nocodb_data:/var
33+
- nocodb_data:/usr/app/data
3434
tmpfs:
3535
- /run:nodev,nosuid,exec,mode=0755
3636
volumes:
@@ -54,7 +54,7 @@ services:
5454
- "80:80"
5555
- "443:443"
5656
volumes:
57-
- nocodb_data:/var
57+
- nocodb_data:/usr/app/data
5858
tmpfs:
5959
- /run:nodev,nosuid,exec,mode=0755
6060
volumes:
Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
---
2+
title: 'Install on Kubernets'
3+
description: 'How to install on Kubernets.'
4+
tags: ['kubernets', 'k8s']
5+
keywords: ['Kubernets']
6+
---
7+
8+
## Prerequisites
9+
10+
- k8s cluster
11+
12+
## Exampke manifest
13+
14+
```yaml
15+
apiVersion: v1
16+
kind: Secret
17+
metadata:
18+
name: nocodb
19+
type: Opaque
20+
data:
21+
NC_AUTH_JWT_SECRET: bm9jb2Ri
22+
---
23+
apiVersion: v1
24+
kind: ConfigMap
25+
metadata:
26+
name: nocodb
27+
data:
28+
NC_PUBLIC_URL: __your_nocodb_domain__.com
29+
---
30+
apiVersion: v1
31+
kind: Service
32+
metadata:
33+
name: aio
34+
spec:
35+
selector:
36+
app: aio
37+
ports:
38+
- protocol: TCP
39+
name: "http"
40+
targetPort: 80
41+
port: 80
42+
- protocol: TCP
43+
name: "https"
44+
targetPort: 443
45+
port: 443
46+
- protocol: TCP
47+
name: "minio"
48+
targetPort: 9000
49+
port: 9000
50+
type: ClusterIP
51+
---
52+
apiVersion: v1
53+
kind: PersistentVolume
54+
metadata:
55+
name: aio
56+
labels:
57+
type: local
58+
spec:
59+
storageClassName: manual
60+
capacity:
61+
storage: 10Gi
62+
accessModes:
63+
- ReadWriteOnce
64+
hostPath:
65+
path: "/var/nocodb_aio"
66+
---
67+
apiVersion: v1
68+
kind: PersistentVolumeClaim
69+
metadata:
70+
name: aio
71+
spec:
72+
storageClassName: manual
73+
accessModes:
74+
- ReadWriteOnce
75+
resources:
76+
requests:
77+
storage: 3Gi
78+
---
79+
apiVersion: v1
80+
kind: Pod
81+
metadata:
82+
name: aio
83+
labels:
84+
app: aio
85+
spec:
86+
volumes:
87+
- name: aio
88+
persistentVolumeClaim:
89+
claimName: aio
90+
- name: tmpfs
91+
emptyDir:
92+
medium: Memory
93+
containers:
94+
- name: aio
95+
image: nocodb/nocodb:latest
96+
envFrom:
97+
- secretRef:
98+
name: nocodb
99+
- configMapRef:
100+
name: nocodb
101+
ports:
102+
- containerPort: 80
103+
- containerPort: 443
104+
- containerPort: 9000
105+
volumeMounts:
106+
- mountPath: "/var"
107+
name: aio
108+
- mountPath: "/run"
109+
name: tmpfs
110+
```
111+
112+
### using the default image
113+
114+
```yaml
115+
apiVersion: v1
116+
kind: Secret
117+
metadata:
118+
name: nocodb
119+
type: Opaque
120+
data:
121+
NC_AUTH_JWT_SECRET: bm9jb2Ri
122+
---
123+
apiVersion: v1
124+
kind: ConfigMap
125+
metadata:
126+
name: nocodb
127+
data:
128+
NC_PUBLIC_URL: __your_nocodb_domain__.com
129+
---
130+
apiVersion: v1
131+
kind: Service
132+
metadata:
133+
name: nocodb-service
134+
spec:
135+
selector:
136+
app: nocodb
137+
ports:
138+
- protocol: TCP
139+
port: 80
140+
targetPort: 8080
141+
type: ClusterIP
142+
---
143+
apiVersion: apps/v1
144+
kind: Deployment
145+
metadata:
146+
name: nocodb-deployment
147+
spec:
148+
replicas: 2
149+
selector:
150+
matchLabels:
151+
app: nocodb
152+
template:
153+
metadata:
154+
labels:
155+
app: nocodb
156+
spec:
157+
containers:
158+
- name: nocodb
159+
image: nocodb/nocodb:latest
160+
envFrom:
161+
- secretRef:
162+
name: nocodb
163+
- configMapRef:
164+
name: nocodb
165+
ports:
166+
- containerPort: 8080
167+
```
Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
11
{
22
"title": "Installation",
3-
"pages": ["auto-upstall", "docker", "docker-compose", "home-brew", "aws-ecs", "gcp-cloud-run", "digital-ocean", "nix", "other-installations"]
4-
}
3+
"pages": [
4+
"auto-upstall",
5+
"docker",
6+
"docker-compose",
7+
"ubuntu",
8+
"home-brew",
9+
"aws-ecs",
10+
"gcp-cloud-run",
11+
"digital-ocean",
12+
"nix",
13+
"nixos",
14+
"nginx",
15+
"apache",
16+
"other-installations"
17+
]
18+
}

0 commit comments

Comments
 (0)