LEMP Raspberry Pi 2 Web Server – Arch Linux, Nginx, MariaDB (MySQL) and PHP

Download the Latest LEMP Raspberry Pi 2 Web Server Image

to do:

– Update my.cnf for RPi2 (1G of memory) and enable InnoDB by default.
– Fix broken PHP modules. (gd, imap and mcrypt)

change log

09-16-2015 – Fixed sshd root access and enabled autostart of sshd on boot.
09-12-2015 – Image tested on 3 different Raspberry Pi 2 boards.
09-10-2015 – performed pacman -Syu
09-10-2015 – Updated to work with Raspberry Pi 2 (arm7). The older version can be downloaded for the first generation Raspberry Pi Arm6 Here,

raspberry pi 2 lemons

Known Insects

– When using the WiFi-menu command to connect to the Internet instead of a network cable. The following is the output: “cfg80211: Calling CRDA to update the World Regulatory Domain” …This can be safely ignored. Let me know if you find a fix in the comments below. I have tried many. it happens No Affects the function of WiFi.

software version
– Arch Linux ARM (rolling release. Use pacman -Syu for updates)
– Nginx 1.8
– MariaDB 10.0.21
– PHP 5.6
– zend opcache 7.0.6-dev

LEMP for Raspberry Pi 2
Transform your Raspberry Pi into an Nginx HTTP Server with Arch Linux ARM + Nginx + MariaDB (MySQL) + PHP. Pre-configured and packaged in a downloadable image.


  • raspberry Pi 2 Model B
  • Power adapter with at least 1.5 amp (2+ amp recommended)
  • Fat32 formatted 4GB SD card (8GB+ recommended)
  • Network cable for Internet access. (or use a wifi dongle)


  • Download LEMP Raspberry Pi Image: archlemp-rpi2.img.tar.gz
  • Remove it. Example: sudo tar zxf archlemp-rpi2.img.tar.gz
  • Write extracted image to SD card. Example: sudo dd if=arch-lemp-rpi.img of=/dev/sdx …change sdx if necessary. Do not run this command when unsure!!!
  • Recommended – Extend partition to use all disks. you can use gparted, (See more: http://elinux.org/RPi_Resize_Flash_Partitions,
  • Plug your internet cable and LEMP installed SD card into your Raspberry… turn it on.

basic entry
pass: root (Please change the password! Use Password Permission)

MySQL Root
Password: changeme

Nginx/PHP Web Root

If you are using WiFi instead of a network cable to connect to the Internet, use the following command to connect to your SSID:


To test Nginx simply visit your Raspberry Pi’s IP address from a web browser. You will see the standard Nginx test page. You can also test PHP by visiting …your.ip/info.php. (replace ‘your.ip’ with the RPi2’s IP address).

Download LEMP to Your Raspberry Pi Via SourceForge.net

Here is a screenshot of the top stats after boot…
This LEMP install is pretty much the default. Providing you the opportunity to tweak to your satisfaction. Once you have installed a MySQL database you may need to edit /etc/mysql/my.cnf as the memory settings I use may be too restrictive. But be careful, you don’t have a lot of RAM to work with on the Raspberry Pi 2, so don’t massively increase the buffers and cache /etc/mysql/my.cnf (You can enable query_cache for starters). Swapping to SD card would be terrible for performance so I added very little swap and the vm.swappiness was changed from 60 to 1. I have tested with wordpress 4.3 and it works fast.


See more…

Leave a Comment