LAMP on a low-end Raspberry Pi?
bikegremlin
ModeratorOG
No, I did not google. ![]()
Yet.
Did anyone install something like LAMP on a low-end Raspberry PI?
Does it work OK for PHP "websites" (MySQL won't be needed most probably)?
Which "install" should I try?
Thanks in advance for any help and tips.
Comments
Which Pi are you looking at ? Have seen YT videos where folks have used Pi Zero all the way upto Pi4,
I used to host a small-ish site on Pi 3B, Ubuntu 18.04 ( this was late 2018/early 19).
I like this guy's videos
blog archives
No idea. It's on my desk, and I'm supposed to make it run. LOL.
Will probably connect it to a monitor in the morning and give it a go if possible. It has a HDMI outlet and USB ports.
🔧 BikeGremlin guides & resources
Tested on raspberry pi 3: https://somik.org/ubuntu-18-04-install-llmp-stack/
If you can run it on a low end VPS, you can run it on a raspberry pi 3 or above. Performance is good for low traffic websites (or personal sites).
I ran from a microSD card. Do not that you may want to run it from a USB 3.0 drive or SSD if possible (and your raspberry pi has a USB 3.0 port).
It is intended to run offline, locally, connected to a big screen for some presentation/service.
🔧 BikeGremlin guides & resources
Pic of the pi ?
blog archives
🔧 BikeGremlin guides & resources
I wont recommend using the "offical" case. It sucks. Not enough airflow and the pi heats up. Also recommend using a fanless tiny heatsink on the pi CPU. Pi 4 heats up a lot compared to Pi 3 and consumes a lot of power. You also need to run it using the "official" power supply as most standard type c power supply cannot provide enough power for it. It needs 5.25V at 3A+
Something like this the following pic. Second picture is the type of heatsink case I use with my raspberry pi 4.
That is sound advise
blog archives
As long as you run it off a SATA ssd not SD card it should OK.
True, with probably only a Gig of RAM on the Pi, extra Swap on SSD would also help
blog archives
Does it need to be an official Raspberry Pi, or is a cheaper alternative allowed as anecdotal "yes, it works"?
For a couple of years I had my children give their friends an Orange Pi Zero for their birthdays (the 512 meg version, mind you; 256 meg would be cheaping out on the wrong parts). I'd put in an "A1" app-class uSD card flashed with Yunohost running mail, Matrix, Nextcloud, Wordpress and the like. Having it combined with a domain of my children's choosing gave it a personal touch.
Taking for granted there would hardly ever be more than a handful visitors/users, the most important caveats were:
I didn't test the boards to their limits, neither did I run any yabs on them.
edit - quoterepair
edit more: Nextcloud and Wordpress would require MariaDB, while Matrix-synapse runs on Postgres. All in all, they were not speed monsters, but I was pleasantly surprised what possibilities there are with such a low powered board.
This is still in the "draft" version.
Nothing is defined, nor set in stone.
Roughly: the idea is to run a simple map "website" (PHP, but no DB) for users via a big touch screen (so, one user at a time).
Maybe it will be connected to the Net, but that's not 100% clearly defined yet.
My task was to see if that stuff can run on the Pi that we have at the moment (no guarantees that it will end up being used by the end).
As far as I understand, as it is, with a SD card, it should be able to run LAMP.
That's a start, and we'll see about what we'll go with and how the Pi wors with its current setup.
(It does have its own power supply - a Pi "charger" with a USB-C connector).
Relja
🔧 BikeGremlin guides & resources
LAMP on a Raspberry Pi 3? We can go lower than that. I run it on a "Raspberry Pi Zero 1 W" which also has TasmoAdmin for controlling Tasmota plugs in house.
Cloudcone | Crunchbits | Dartnode | Dedirock | Georgedatacenter | Gigahost | Hostbilby | Host-c | Hostdzire | Hostsailor | Namecrane | Nuyek | Realtoxmedia | Servarica | Terabit | Tnahosting | Virmach
Jeez, that's high end equipment guys! I have an original Model B Pi.
Must dust down "Orac" and fire it up again, with DietPi
In stasis until the shitposting stops/abates.
Than=compare;then=sequence:brought=bring;bought=buy:staffs=pile of sticks:informations/infos=no plural.
It wisnae me! A big boy done it and ran away. || NVMe2G for life! until death (the end is nigh).
Experience man... Did burn a few SD cards before finding out that heat is not a friend of SD cards...
No need. MicroSD is enough for regular use. I have 4xPi 3s running fully of microSD cards 24/7 for over 2 years. As long as the program does not write to the card very often, modern micro SD cards are good enough for these types of operations. Yes, it will be slow but will do fine in a pinch.
Agreed here. The USB out on router is not enough even for my ESP32 board...
That's some "low-end-hosting" you got going on in there! My Pi zero 1w is unofficially retired as I just got my Pi 2w.
Time for an upgrade! Get the new Pi 5. I have yet to get one myself but I hear good things about it (except for the price...)
https://www.raspberrypi.com/products/raspberry-pi-5/
Ahh, don't you understand my username?

RPi 5=megabucks
Wasted on me,with my single FullHD plasma TV.
In stasis until the shitposting stops/abates.
Than=compare;then=sequence:brought=bring;bought=buy:staffs=pile of sticks:informations/infos=no plural.
It wisnae me! A big boy done it and ran away. || NVMe2G for life! until death (the end is nigh).
It's a bad idea
Amadex • Hosting Forums • root.hr
i was also tempted to buy a Pi Zero 2W, but I got discouraged by the same problems which put me away in buying a Pi 4 or Pi 5 later - that's temperatures. Yes, those come with more power, but also come with more heating and thermal throttling. Personally I love passing cooling - to leave them hidden in some corner of the room and forget about them. Besides, I don't really need all that computing power in such a small form-factor, nor do I need all that 4K video and whatnot.
I stopped at Pi 3 used for Retropie (on which I have an aluminium case) and Pi Zero 1W (on which I use the official plastic case). I do not intend to buy any newer version of Raspberry Pi due to temperatures. My attention nowadays started going into NanoPi boards, for keeping things low, small, and cheap
Here is an uptime of that Raspberry Pi Zero 1W:
Cloudcone | Crunchbits | Dartnode | Dedirock | Georgedatacenter | Gigahost | Hostbilby | Host-c | Hostdzire | Hostsailor | Namecrane | Nuyek | Realtoxmedia | Servarica | Terabit | Tnahosting | Virmach
Yours is 4, so isn't a low-end one, actually.
Yes, it will work even for heavier stuff. I know a guy, who uses some Pis as a CCTV DVRs (security surveillance) in his office.
Raspberry Pi hosting is even offered as a service - collocation / dedicated:

If lazy, contact Selectel support and ask what are the typical software installs they offer for Pi 4:
https://selectel.ru/en/prices/
Modern microSD cards are getting less and less reliable, unfortunately.
Besides the amount of data written and free space available, temperature is also important.
☰ VDS & Storage — Budget AMD EPYC VDS (ref) from $4/m / Big HDD VPS (ref) from $2/TB/mo / EPYC/Gold/Platinum dedis (ref) w/ GPU support
I intend to do something like that too, with an automatic upload of the data into some cloud, or store it on an external HDD. I need to find the time for it.
Cloudcone | Crunchbits | Dartnode | Dedirock | Georgedatacenter | Gigahost | Hostbilby | Host-c | Hostdzire | Hostsailor | Namecrane | Nuyek | Realtoxmedia | Servarica | Terabit | Tnahosting | Virmach
IIRC, this is one of the popular options for that: https://www.home-assistant.io/installation/raspberrypi/
☰ VDS & Storage — Budget AMD EPYC VDS (ref) from $4/m / Big HDD VPS (ref) from $2/TB/mo / EPYC/Gold/Platinum dedis (ref) w/ GPU support
Well, I have managed to install an Apache web server and PHP.
PhpMyAdmin install was a bit problematic, but that probably won't be needed anyway.
MySQL might have been installed properly, but I haven't tested that.
The unit does overheat in the original case.
).
It works very slowly when trying to use its crhomium browser (gets stuck/hung up on a lot of web pages - when opening one page). The uBlock installed on that browser doesn't seem to be blocking any ads (LES and BikeGremlin sites work wonderfully though
Will see when Gox returns from holiday if that's good for him, and if he ends up using it at all.
It took a few hours for me to get it to this stage (didn't have access to a separate computer for googling - that was my biggest problem really).
So far so good.
🔧 BikeGremlin guides & resources
Congratulations, some headway indeed!
If open to lemp, webinoly in u 22.04 arm works quite well…
Or
HestiaCP on Debian 12 / U 22.04 arm. You can opt for apache install in the script
Makes the job easier
blog archives
Even more lightweight but more limiting: I used to install Lighthttpd on my Rpi 3B+
Ympker's VPN LTD Comparison, Uptime.is, Ympker's GitHub.
If you wish to run a desktop on a Pi it works, but expect no more than some decent performance. A Raspberry Pi weights less than 50 grams, so everything ran on it needs to be light, while modern browsers tend to be... bloated.
With regards to uBlock, try the lightweight version as it would be more suitable on a lightweight Pi.
Cloudcone | Crunchbits | Dartnode | Dedirock | Georgedatacenter | Gigahost | Hostbilby | Host-c | Hostdzire | Hostsailor | Namecrane | Nuyek | Realtoxmedia | Servarica | Terabit | Tnahosting | Virmach
Dear Biciklo Gremlin, try HestaCP. It supports ARM cpu.
Amadex • Hosting Forums • root.hr
I believe I run it on the first gen RPi. No problem if your load is minimal.
DM us for private tracker invite.
That's not been my experience...I've thrown out a handful of SD cards over the last couple years. What you say about don't write too often is precisely the issue...it's only a matter of time till it craps itself & you're always hoping there isn't some rogue software writing logs all the time or whatever. It can be fine even for years as you say but been on the losing side of that roll of dice once too often.
Eventually decided to just spend the 25 bucks on an adapter & ssd - crucially makes the entire pi feel tangibly faster too. But I also get that its not cheap especially when kitting out a cluster
Still have two on SD cards where I just don't care (pikvm - usually off, and ADS-B receiver which whatever).
The best porn is 460p anyways!!!
The Yeti has left the building.
The yeti is old-schooled. The yeti knows. 🍻
Cloudcone | Crunchbits | Dartnode | Dedirock | Georgedatacenter | Gigahost | Hostbilby | Host-c | Hostdzire | Hostsailor | Namecrane | Nuyek | Realtoxmedia | Servarica | Terabit | Tnahosting | Virmach
I see your point... My raspberry Pi Zero 2W "needs" a passive cooler along with a fan nearby, otherwise it thermal throttles. Same with my Pi 4 which needs a full on 1 KG aluminum cooler case and still gets too hot to touch when heavily loaded with CPU/GPU intensive work...
My Sandisk Ultra 128 GB microsd cards may be 3~4 years old but are extremely reliable. I did burn one of my Samsung 256 GB microsd card from overheating in a raspberry pi 4 in it's "official" case while the other 64 GB Transcend card got burned while transferring data on my PC using a usb 3.0 card reader... The reader got so hot, I could not unplug it from the PC, the card stopped responding and had to shut down the PC to unplug the card reader...
I have not had much cards fail on me. Only the 2 I listed above + one card that failed after using for 2 years in my phone and another few years in the raspberry pi running my door camera. It was constantly writing the video files to the SD card and deleting the old ones. Still lasted over 2 years without any issue. Since the card only had enough space to write 15 days of videos, it was getting overritten every 15 days. Also I suspect it failed due to heat, not overwritting as it died during an specially hot day.
According to the internet:
"An SD card’s lifespan has everything to do with how frequently it is used. According to HowStuffWorks, memory cells in micro SD cards can undergo up to 10,000 write-and-erase cycles before wearing out. Since 10,000 write cycles are the equivalent of writing and erasing the card’s content daily for nearly 30 years, memory cards are generally long-lasting."
I have found the USB to Sata adapters to be generally less reliable then the microSD cards. However USB to PCIe SSD adapters are good and I had used one in the past. But I did not see much difference in speed compared to using a fast USB 3.0 thumb drive. How is the performance for you?
Also PiKVM uses a readonly OS so nothing is written to the MicroSD card until you ssh in and run the "rw" command as sudo.
If a standard MicroSD becomes a concern, maybe a better option would be a MicroSD with "endurance" tag as these should last longer.
Cloudcone | Crunchbits | Dartnode | Dedirock | Georgedatacenter | Gigahost | Hostbilby | Host-c | Hostdzire | Hostsailor | Namecrane | Nuyek | Realtoxmedia | Servarica | Terabit | Tnahosting | Virmach
Radxa Zero 3W would come in mind.
Personally I stick to raspberry pi cause they have better firmware support and documentations for those edge cases where things don't work.
Or just netboot the Pi. Problem solved (although you do then need a server to netboot it off...)
Yes...in theory SD cards should be fine, but in practice for me at least it isn't.
Maybe its the brand - mix of samsung cards and sandisk.
I wouldn't for a raspberry...those can pull more peak current than rasps can provide so you risk intermittent errors. Might be OK on rasp5s though - think they have more power budget than 4s
Both for Pi 4 and Pi 5 they are ok as long as you are connecting to the USB 3.0 ports. SSDs pulls a lot less power then mechanical harddisks and dont have spikes during spin-ups. As for Pi 3, ya... i tried it once and it broke the adapter. Probably cause of the cheap chinese adapter...
@bikegremlin
I had a pi-4b collecting dust for the past 9ish months, finally got time to put it together and this is what I did.
Booted it up with raspbian, ran yabs.sh and noticed temperatures going up as high as 70*C.
Felt bad, shut it down.
Ordered an Aluminum armor case with two fans(it isn't loud at all, not even noticeable).
I also used dietpi instead of raspbian, they claim to be much faster + more feat. than raspbian.
After armor case + dietpi, yabs took the temperature upto a max of 55*C.
I would really suggest getting that case for cooling, and a USB to SATA converter for the ssd for the files.
dietpi has a built-in installer for a LAMP stack btw, dunno how well mysql will function though.
I wouldn't worry too much about it; Pis are pretty good at throttling themselves before they actually do any damage (to themselves; they might still set fire to your bench)
It's unfortunately a lot sketchier than that.
USB 3.0 spec is max 0.9A
Sabrent reckons a SATA drive peak draw is 1.5 while nvme can peak at 3.. Plus conversion loss from 5V to 3.3V for nvme. So it's getting less than a third of what max required.
A lot of them will power on and work but likely be in a severe undercurrent state frequently...specifically whilst writing. And there are no obvious indications / warnings.
Pi 4 max current output for usb is 1.2 A (total) at 5V, which is 6W. That's a 6W for just one port if you stick to only 1 port. Although if you read the specs, it would seem like it's not enough for Sata SSD which draws "5-8 watts when writing data", that's only if you can saturate the bus, which a USB port can't do. In reality, USB power consumption when using a USB 3.0 port is only around 2~3W while writing at 120~150 MB/s (as per my test) on a Sandisk 500GB SATA SSD using a Ugreen USB3.0 to SATA cable. Similar power consumption for 500GB Samsung 970 Evo Plus nvme to SSD connected over a USB 3.0 USB to nvme adapter. That would be why I stopped using a SSD with my raspberry pi. It's just too slow...
EDIT:
The power consumption was measured using a USB passthrough power meter.
Similar measured power consumption on two devices with very different desired power draws because they're both being connected to a constrained source.
Your nvme is throttled to a low power state - arguably not a bad outcome given other options are not powering on or losing data.
I've since discovered that one does get lower power nvmes though. e.g. Patriot P300 @ 2W. Wish I had know that earlier.
At this point, after having checked out the prices of mini PCs and touch-screen large screens, we are considering going down that route (with a couple of thousand $ for a screen, saving $100 on the "computer"/computer won't make much of a difference).
Now, the trick is which 50+ inch touch screen to choose and how to lock the touch screen users from using anything except one website (run either online, or from a PC LAMP/WAMP install).
Relja
🔧 BikeGremlin guides & resources
Exactly. When connected to a motherboard's NVMe port, the drives heats up and requires at least a fan blowing on them while in a raspberry Pi, they stay cool. So they are definitely getting throttled. Not sure if it's due to the low x1 PCIe 2.0 cause of the USB or the actual power limited due to controller not getting proper power...
I would get a mini PC every day of the week. Got 2 Gigabyte Brix froma few years ago running Intel Pentium Silver J5005 Processor which are slow as F but MUCH faster then even my Pi 5. Moreover, you can use a M.2 SSD as well as a SATA SSD in the same enclosure.
As for the touch screen, just running the site on full screen should be enough to "hide" all navigation bars. Chrome does support "kiosk" mode which disables all navigations.
That is my impression too. Raspberry Pi makes sense for controllers and similar things where low power consumption and compact size are more important.
🔧 BikeGremlin guides & resources
Yes, the primary feature of raspberry pi is the low power and the access to all of it's GPIO pins. Moreover it was a low cost solution to prototyping (not sure I can say that anymore, with the Pi 5 costing 100+ dollars).
In my opinion at $100 one can simply buy an old second-hand laptop for hosting projects and whatnot.
Raspberry Pi has shifted from a cheap low-power board with low thermals on passive cooling, into a pricey high-power board with thermal throttling and active cooling. Maybe the target consumer has simply changed to make room for more investments and profits.
In my opinion the best low-end Pi versions in my opinion remain Pi 3B+ and Pi Zero 1W. Everything beyond that is just bells and whistles for desktops which I personally don't need; but I know many people wanted because it still sells like hot bread.
Cloudcone | Crunchbits | Dartnode | Dedirock | Georgedatacenter | Gigahost | Hostbilby | Host-c | Hostdzire | Hostsailor | Namecrane | Nuyek | Realtoxmedia | Servarica | Terabit | Tnahosting | Virmach
I got 5 Pi 3 B+ & 2 Pi Zero W that agrees with you.
I also got 2 Pi 4 B & one Pi Zero 2W that disagrees with you
I regularly use the Pi Zero 2W with passive heatsink running Pi KVM. It's slow and it does thermal throttle unless you point a fan at it, but it's better then the latency experienced with a Pi zero w and it does not require additional power like a Pi 4 B, so it's a good compromise....
https://www.fully-kiosk.com/
Fully kiosk software which could be used in cheapo tablets. If i am not wrong the idea was based on something fro that
I believe in good luck. Harder that I work ,luckier i get.
The zimaboards and zimablades are currently on sale too fyi...better fit for things that need x86