So far, I’ve covered overclocking your Raspberry Pi, preparing to run your Raspberry Pi as a web server, installing Apache, PHP and MySQL and installing PhpMyAdmin. I’m assuming you’ve at least set your hostname and installed Apache, PHP and MySQL on your Raspberry Pi for this tutorial.
Before we go ahead and install WordPress, we need to ensure that outgoing email can be sent from your Raspberry Pi. In this tutorial, I’ll cover installing Postfix, which is a mail transport agent.
Step 1 – Make sure you’re up-to-date
To begin, run the following command to make sure you’re running the latest software updates:
sudo apt-get update
Any updates available will be downloaded and installed.
Step 2 – Begin the Postfix Installation
Once done, go ahead and enter this command to get the ball rolling:
sudo apt-get install postfix
The postfix setup will now start. You will see a blue screen with some information on the various configuration types, arrow down to ‘ok’ to continue.
Next you will be given the options available. Choose ‘internet site‘ from the list:
Once you’ve chosen this, go to ‘ok‘ to continue.
Step 3 – Configure your Postfix FQDN
The final step is to configure the FQDN. It is important that you’ve already set the hostname (see my tutorial which includes this) as we’re asked to confirm it at this stage.
Set the system mail name to your fully qualified domain name. For example, my Raspberry Pi uses the FQDN ‘dingleberrypi.com’, so I entered dingleberrypi.com here:
Once you’ve entered this, double check it and the go to ok. That’s it, you’re ready to rock and roll! You’ll now be able to receive mail from your Raspberry Pi web server!
I am setting up a wordpress server on my raspberry pi and I cannot seem to get mail working. I have tried sending mail to several account and have also re-installed all the software on my pi twice. Any Ideas? Also what ports do you have open?
Thanks
Nathan
I installed a WordPress blog on my Pi and it installed and works great for playing around.
What I use for mail is a WP-plugin called Configure SMTP. It is simple to configure and works for me.
Could you help me to install wp-plugin? maybe a step-by-step introduction would be appreciate!! Thanks
Hey I am so glad you made these tutorial, so much help!!!
But, you might want to include apt-get upgrade so the new updated packages get installed.
I hope I have not been stressing your Pi by coming by so often 😛
An excellent website. I’ve spent hours searching for this information, and since finding this website my progress has been rapid.
I’ve got my wordpress up and running on my raspberrypi,
http://www.cliffpackman.com
Forever indebted for your skills,
Thanks,
Cliff
I *think* this magically fixed my PHP email not working for actual websites. (PHP scripts in the OS did work though :s)
Thanks!
Hey, great website, followed this to get my pi running a webserver. Running php5, apache2 and phpmyadmin as well as all the other mysql stuff…
I wanted to send emails, automatically, through php scripts… but the mail() function never works, and I’ve tried so many different mailing servers and systems… I hoped this would work seems as it’s on the same tutorial that I built the rest from…
I dunno where to start as to why it doesn’t work… is there any changes I need to make to the php.ini in apache2 to make it work?
Any help with this would be much appreciated!
😀
It should just work. Try using one of the many SMTP plugins for wordpress, I recommend Postman: https://wordpress.org/plugins/postman-smtp/
I have a registered domain (example.com). My hostname for the pi is example. should I change the hostname to example.com instead of example? Should I do the same with the system mail name on PostFix? Thanks.
It should be ok, just ensure your postfix and apache configurations are correct.
photo show after shaving
php scripts on a.i. windows8.1