

From another computer on the same network, you should be able to access it by visiting or as long as your Raspberry Pi’s hostname is raspberrypi. On the Raspberry Pi itself, you should be able to go to and see a test page. Restart apache2 for all changes to take effect.Install the php-mysql connector so that php pages can access the database.Install mariadb so you can use a mysql database with your website.sudo apt-get install php libapache2-mod-php -y.Some users also configure the Raspberry Pi to boot directly from the command prompt. You can get there by pressing CTRL+ALT+T from the Raspbian desktop or by connecting remotely via SSH if you have it configured. Navigate to the command prompt/terminal.Learn how to set up a LAMP (Linux, Apache, MySQL, PHP) stack on your Raspberry Pi and configure it to function as a web server. If you need to install Raspbian, check out our tutorial on how to set up a Raspberry Pi, or better yet, how to set up a headless install (not shown). These instructions will work on almost any model, including the mighty Raspberry Pi 4 and the tiny Raspberry Pi Zero W. Owning a small cloud has many benefits, including customization, free storage space, free internet services, a path to open source software, quality security, full control over your content, the ability to make quick changes, a place to experiment with the code and more, more.įor your web server to work, you need a Raspberry Pi connected to your local network and running a relatively recent version of the Raspbian operating system.

In fact, at Tom’s Hardware, we have a local Pi web server that we use to serve the content for our laptop’s battery test, which is continuously surfing over Wi-Fi. Whether you need an intranet for your office or a small server for web development, Pi is a great fit. One of the most popular uses of the Raspberry Pi is as a web server on your local network. From another computer on the same network, you should be able to get there by visiting or provided that your Raspberry Pi's hostname is raspberrypi.Check How to set up a Raspberry Pi web server Restart apache2 so all of the changes are running.Ĩ. Install the php-mysql connector so php pages can access the DB.ħ. You must do the formal install by typing: Install mariadb so you can use a mysql database with your website. Sudo apt-get install php libapache2-mod-php -yĥ. This will make sure that you get the latest versions of every file you download after this.
