Pinterest Stumbleupon Whatsapp
Ads by Google

Need a low-powered device to run your website? Need the space your web server is taking up? Want to share some potentially controversial information with a select group of people but don’t have the financial resources to run a full-scale web server?

The solution to all of these problems — and some others — is to host your web page on an Android device, turning your smartphone or tablet into a web server.

The Inexpensive Way to Power a Website

Websites do not need expensive servers; they don’t even need inexpensive servers The Best Web Hosting Services The Best Web Hosting Services Are you looking for the best web hosting services for your needs? Whether you need a place to host your small personal blog, or a major corporate website, this list is for you. Read More . We’re now at the stage where a dynamic, database-driven website can be hosted on a modest device. For instance, it might be a common desktop PC or laptop, but as this takes up a lot of space, you can scale back. We’ve already seen how the Raspberry Pi can be used as a web server Turn A Raspberry Pi Into A Web Server With Google’s Coder Turn A Raspberry Pi Into A Web Server With Google’s Coder Google’s Creative Lab has turned out some software that helps turn a Raspberry Pi into a basic web server. The tiny web server can then be used for web based developmental projects. Read More , and it’s also possible to use an Android smartphone or tablet in the same way.

Your hosting costs are immediately removed, and as long as the page views are low, you should find that your website runs without locking up the device (although you shouldn’t be expecting to be able to multitask while the site is running!).

Installing Your Server Software on Android

Various server software apps are available for Android. These range from the straightforward PAW Server for Android designed to run basic, non-dynamic sites (although a PHP plugin is available for PAW) to Ulti Server: PHP, MySQL, PMA, which, as the name suggests, supports the use of database driven websites written in PHP.

We’re using PAW Server for this tutorial, with which we’ll upload a basic index.html file and browse to from a PC on the same network to illustrate using Android as a web server. Other apps rely on all of the same principles — the same concepts and processes are required to serve a web page to a viewing browser.

Ads by Google

Configuring PAW Server

muo-android-webserver-paw-start

With PAW Server installed on your device, run the app, pressing the start button as instructed. A URL will be displayed, so browse to this on your desktop computer. Here you’ll be invited to login, using the displayed credentials, and open the server console.

This is a useful app with a variety of features, from making phone calls and sending messages to viewing media. Basically, you can use PAW Server as a remote access console to your phone or tablet as well as serving web pages.

Here’s a look at what it can do:

Adding Index.html to PAW Server

To use PAW Server as a web server, you’ll need to create an index.html file and upload it to the correct folder. You can do this on your desktop using a text editor like Notepad++ (one of our favorite Windows applications The Best Windows Software The Best Windows Software Windows is swimming in a sea of free applications. Which ones can you trust and which ones are the best? If you're unsure or need to solve a specific task, consult this list. Read More ) or on Android using a HTML or text editor Yes, You Can Code On The Go: 4 Of The Best HTML Editors for Android Yes, You Can Code On The Go: 4 Of The Best HTML Editors for Android While Android is a great platform for Facebook and Angry Birds, it can also be a viable mobile solution for web developers. However, web developers can't be pleased with just any regular old text editor... Read More .

muo-android-webserver-paw-html

With your file created, copy it into the /paw/html/ directory on your Android device — this is easily done by expanding the Media section in the PAW Server console and selecting File Manager. From here, browse to sdcard/paw/html, click Choose File, select the HTML file you just created and click Upload.

To view the file in your PC browser, you’ll need to restart PAW. On your tablet, tap the Stop button in PAW Server, then Start again. Navigate in your browser once again to the displayed URL, this time adding /index.html to the end.

muo-android-webserver-paw-live

Congratulations, you converted your Android device into a web server! The example shown is basic and lacks styling; CSS can be easily added (and is simple to learn 5 Baby Steps To Learning CSS & Becoming A Kick-Ass CSS Sorcerer 5 Baby Steps To Learning CSS & Becoming A Kick-Ass CSS Sorcerer CSS is the single most important change webpages have seen in the last decade, and it paved the way for the separation of style and content. In the modern way, XHTML defines the semantic structure... Read More ) with the usual included instruction in the HTML file.

Receive External Hits On Your Android Powered Website

As you may have discerned from the screenshots, I’ve used a tablet for this tutorial. However, there is no reason why you shouldn’t use a smartphone.

Whichever Android device you select, when used in conjunction with a dynamic DNS update client 5 Best Dynamic DNS Providers You Can Lookup for Free Today 5 Best Dynamic DNS Providers You Can Lookup for Free Today DynDNS was always a top mention when free dynamic DNSes were brought up. But now that it's gone, are there any good alternatives? There sure are. Read More (of these, No-IP.com has an Android app), you’ll be able to serve web pages to computers beyond your home or corporate network. These apps link your device’s dynamic IP address to a dedicated URL, via the client app that you install.

(Of course if your ISP provides you with a static IP, all you will need to do is assign your Android web server a static IP address, but this may prove unworkable with some routers, so the No-IP.com app is the better option. Various unofficial No-IP.com clients are available, with Dynamic DNS Client a strong option.

Uses for an Android Web Server

We’ve covered various ways in which you might employ an Android-powered web server throughout this feature, but just in case you missed them, let’s remind ourselves.

To begin with, you can use an Android web server to host test versions of websites. This is useful for ironing out bugs and tweaking the design before the site goes live, and saves you installing development websites locally which then have to be painstakingly migrated to your server when ready 3 Plugins for Easily Migrating a WordPress Site, Tried & Tested 3 Plugins for Easily Migrating a WordPress Site, Tried & Tested These Wordpress plugins can semi-automate the entire process of migrating a WordPress site for you. Read More .

If the website is relatively basic, you can use Android as a host and save money on powering an expensive server. Similarly, the space taken up by a server or PC running as a web server can be reclaimed, perhaps using the server for a different purpose. The space occupied with a PC running a web server could now be taken by a person, doing a job.

Have you build an Android-powered web server? Curious and want to know more? Leave a comment below, and we’ll talk.

  1. Neeraj Vashisht
    November 3, 2015 at 7:14 pm

    Sorry if this is beyond the scope of this discussion. I am trying to set up a webserver on an android device A. Other devices connect to this device via a local hotspot created using the android device by typing 192.168.43.1:9090 in the browser. Is there a way for other devices to connect to the device using a domain name (so the user doesn't have to type the 192.168.43....address). I would like the process to be fully offline (ie no internet dependency)

    Any help or pointers will be highly appreciated...thank you

    Regards

    Neeraj

  2. Tom Esparon
    August 9, 2015 at 7:37 pm

    I recently did a similar thing with an iPhone 3GS using 'ios-lighttpd-php-mysql'. Most of the setup is found here:http://ios-webstack.tk/install

    I then made a quick wordpress blog and owncloud and have a static IP port forwarded. have not set up NO-IP yet but might conisder if I use it more often. It is a great repurposing of an old iPhone IMO even just as a side-project

  3. Pankaj C.
    August 8, 2015 at 9:21 am

    Interesting article. I have a few questions though.

    Can I use my domain name with a smatphone hosted website?
    Does the website loading speed depend on the internet connection speed of my phone?

    • Christian Cawley
      August 8, 2015 at 9:12 pm

      You can, if you use the method linked to above with No-IP.com, but speed will depend on ISP and device.

Leave a Reply

Your email address will not be published. Required fields are marked *