Build Your Own Personal AI Bot for Free | Raspberry PI | N8N workflow | AI Project DIY

profile picture

Janishar Ali

01 Jul 2026

Build Your Own Personal AI Bot for Free | Raspberry PI | N8N workflow | AI Project DIY

Linux commands for the Youtube video


# SWAP
sudo fallocate -l 1G /swapfile
ls -lh /swapfile
sudo chmod 600 /swapfile
ls -lh /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon --show
sudo cp /etc/fstab /etc/fstab.bak
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab

cat /proc/sys/vm/swappiness
sudo sysctl vm.swappiness=10
echo 'vm.swappiness=10' | sudo tee /etc/sysctl.d/99-swappiness.conf sudo sysctl --system
cat /proc/sys/vm/swappiness

# upgrade operating system
sudo apt update
sudo apt full-upgrade -y
sudo apt autoremove -y
sudo reboot

# docker compose
https://docs.docker.com/compose/install/linux/
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
docker compose version

# n8n
mkdir n8n-compose
cd n8n-compose

nano .env
```
# Whether to use secure cookies (should be true if using HTTPS)
N8N_HOST=localhost
N8N_PROTOCOL=http
N8N_PORT=5678
WEBHOOK_URL=http://localhost/

# Security
N8N_PROXY_HOPS=2
N8N_TRUST_PROXY=true
N8N_SECURE_COOKIE=false
N8N_BASIC_AUTH_ACTIVE=true
N8N_BASIC_AUTH_USER=piuser
N8N_BASIC_AUTH_PASSWORD=123456

# Timezone
GENERIC_TIMEZONE=Asia/Kolkata

# Hardening
N8N_COOKIE_DOMAIN=localhost
N8N_PUBLIC_API_DISABLED=true
N8N_DIAGNOSTICS_ENABLED=false
N8N_VERSION_NOTIFICATIONS_ENABLED=false
N8N_TEMPLATES_ENABLED=false
EXTERNAL_FRONTEND_HOOKS_URLS=
N8N_DIAGNOSTICS_CONFIG_FRONTEND=
N8N_DIAGNOSTICS_CONFIG_BACKEND=

EXECUTIONS_DATA_SAVE_ON_SUCCESS=false
EXECUTIONS_DATA_PRUNE=true
EXECUTIONS_DATA_MAX_AGE=168
```
mkdir local-files
nano compose.yaml

```
services:
n8n:
image: docker.n8n.io/n8nio/n8n
restart: always
env_file:
- .env
ports:
- "5678:5678"
volumes:
- n8n_data:/home/node/.n8n
- ./local-files:/files

volumes:
n8n_data:
```

sudo docker compose up -d

hostname -I
sudo docker compose stop
docker compose down
docker compose up -d
YOUTUBE
AI
profile picture
Written by Janishar Ali

Share this article and spread the knowledge