detached 706629d

docs(readme): fix port forwarding to use UFW instead of iptables-persistent

iptables-persistent conflicts with UFW and removes it. Updated guide to
use UFW's before.rules for NAT port redirection instead.
commit
706629df2d51d3c7c9c3527fe338c5c6767a530b
author
brice · · 2026-01-14 05:38 UTC
parent
b91fac7
signature
unsigned
1 file · +20 -6
M README.md +20 -6
@@ -220,16 +220,30 @@ sudo ufw --force enable
220220 ```
221221
222222 ### 2. Port Forwarding (rootless requires this)
223+
224+Rootless containers can't bind to privileged ports (< 1024). Redirect 80/443 to unprivileged ports:
225+
223226 ```bash
224-# Forward 80/443 to unprivileged port 8080
225-sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
226-sudo iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-port 8080
227+# Add NAT rules to UFW's before.rules (persists across reboots)
228+sudo tee -a /etc/ufw/before.rules > /dev/null << 'EOF'
229+
230+# NAT rules for rootless container port redirection
231+*nat
232+:PREROUTING ACCEPT [0:0]
233+-A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
234+-A PREROUTING -p tcp --dport 443 -j REDIRECT --to-port 8443
235+COMMIT
236+EOF
227237
228-# Make persistent
229-sudo apt install -y iptables-persistent
230-sudo netfilter-persistent save
238+# Reload UFW to apply
239+sudo ufw reload
240+
241+# Verify rules are active
242+sudo iptables -t nat -L PREROUTING -n
231243 ```
232244
245+> **Warning:** Do NOT use `iptables-persistent` - it conflicts with UFW and will remove it. The method above integrates with UFW properly.
246+
233247 ### 3. Rootless Container Setup
234248 ```bash
235249 # Enable user namespaces
@@ -220,16 +220,30 @@ sudo ufw --force enable
220 ```220 ```
221 221
222 ### 2. Port Forwarding (rootless requires this)222 ### 2. Port Forwarding (rootless requires this)
223+
224+Rootless containers can't bind to privileged ports (< 1024). Redirect 80/443 to unprivileged ports:
225+
223 ```bash226 ```bash
224-# Forward 80/443 to unprivileged port 8080227+# Add NAT rules to UFW's before.rules (persists across reboots)
225-sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080228+sudo tee -a /etc/ufw/before.rules > /dev/null << 'EOF'
226-sudo iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-port 8080229+
230+# NAT rules for rootless container port redirection
231+*nat
232+:PREROUTING ACCEPT [0:0]
233+-A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
234+-A PREROUTING -p tcp --dport 443 -j REDIRECT --to-port 8443
235+COMMIT
236+EOF
227 237
228-# Make persistent238+# Reload UFW to apply
229-sudo apt install -y iptables-persistent239+sudo ufw reload
230-sudo netfilter-persistent save240+
241+# Verify rules are active
242+sudo iptables -t nat -L PREROUTING -n
231 ```243 ```
232 244
245+> **Warning:** Do NOT use `iptables-persistent` - it conflicts with UFW and will remove it. The method above integrates with UFW properly.
246+
233 ### 3. Rootless Container Setup247 ### 3. Rootless Container Setup
234 ```bash248 ```bash
235 # Enable user namespaces249 # Enable user namespaces

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 7

Tags 106

↑↓ moveenter openesc close