Raspberry Pi 4 as a NAS and VPN server

So, I've been trying to set up my RPi4 as a NAS server, HTTP server and VPN server.
But to be honest, I'm failing kinda hard at doing any of those.
For the NAS server, I managed to conect a Terabyte HDD to the Pi and mount it, after trying for a few hours, and I tried installing samba4 server as well, but I hadn't configured it yet.
So, I tried installing an HTTP server with PHP, and I tried with almost all the options I could find tutorials here on the site, first with Apache, then with lighttpd, then with uHTTPd, and none of them could even show anything on port 81...
I'm using the newest openwrt firmware version, since I've tried setting it up first to serve a connection through OpenVPN to my other router, but I also couldn't manage to make it work properly, in some of the older snapshot versions.

My objectives are simple:

  • Have an HTTP server to serve a simple website only over LAN, with PHP
  • Have a NAS server with Samba server where I can share files over the LAN on that HDD
  • Have a VPN connection that gets sent to the other router where it's distributed over the computers and phones around here
  • Have the Pi also send an wi-fi so I can connect to it and browse without going through the VPN

So... Where do I start fixing it?

Search Google,
You will get everything what you want

Install Ubuntu or Debian as OS

for this Nextcloud can be used

you can install vpn on rpi and provide rpi ip as router/gateway on other phones to connect vpn.
try this


even look for open media vault

So... I'm trying to do that on OpenWRT, because I thought since it was created for that purpose, it should do it faster and be lighter... But the suggestions are for... Not to use it?
Would Debian or Ubuntu be better at doing those things on a RPi4 than Openwrt?

Both matters are differ thing,
I u want to use it as router than go with openwrt, there h can have samba for local sharing of files.
And Aldi vpn too.
Don’t know about http,

You're probably best off running like Raspbian or something if you're going to use a RPi4

1 Like

How can I install openwrt alongwith raspbian?

Will you be using the pi as a router? If not, there is no reason to use openwrt (compared to the raspberry pi os).

1 Like

Hosting web-site is NOT function of router, so OpenWRT is not recommended for this purpose. It is recommended for NETWORK features.

1 Like

Well, I'll be using it to route the VPN connection to the actual router, but also have a wi-fi connection for not-vpn connections, thats why I was going to use OpenWRT... But is that so minor of a routing need that it doesn't make sense to use openwrt?

Not really a website, just wanted to have some information accessible and editable via browser on LAN

Using the raspberry pi os will probably be best. You can install a vpn on that os quite easily and also nas functionality and whatever web front ends that you want.

This is what I use:
RPI4 (overclocked to 2ghz)
4TB USB3 Disk (powered)
TP-Link VLAN capable switch
Raspberry Pi OS Lite (Debian 10) - haven't upgrade to 11 yet - waiting for 64Bit.
eth0.1 vlan internal network
eth0.16 vlan external network
nftables for firewall
pppoe to my ISP
-container with pi.hole for DNS & DHCP
-container with samba for file share
-container for linuxserver/wireguard - recommended
Handles 1GbE fine to the USB3 disk
iperf3 (no wireguard) manages 1GbE routing
I only have 100Mbps external link and Wireguard seems fine