Android Web Server – PHP & MySQL – Port Forwarding & Dynamic DNS


It’s amazing how quickly technology evolves nowadays… something you wouldn’t even think could be possible, simply happens right before your eyes. Ten years ago, I first acquired my first computer and began making websites in HTML for fun, learning about web servers, programming etc.; back then, even to setup a simple local server was complicated for me. Fast forward ten years and we can carry a web server in our pockets and make changes to our website while taking a subway to central park. 😉

Android Devices

If you have been using Linux for a while, then you most likely know the feeling of using a system built upon a concept that is “simply right”. The open source model along with world-wide collaboration gives the user a feeling of being a part of something special. The evolution from the earlier Linux distributions up to today is huge… it is no surprise that most supercomputers run Linux. Not a surprise that most smartphones run Linux either. You could probably run Linux on a toaster, but that is beyond the scope of this article.

With Android it is no different. Although being a late competitor in the smartphone race, it clearly took over the game quickly — which reminds me, happy fifth birthday Android! In my opinion, being Linux-based and open source made a difference in comparison with other brands of smartphones out there that never really took off. The freedom Android provides is also critical to it’s success when it comes to giving the user full control of their device… which brings us to this article.


To follow along with this tutorial, you will need certain applications. Before taking a look at them, I would like to inform you of the system and settings that I used to achieve this — just in case you’re wondering. My phone is considerably old now — HTC EVO 4G — but compared to the newer ones out there, I haven’t felt the need to upgrade yet. Also important to note that I have an unlimited plan and pay no extra fees for bandwidth or the like, which could be an issue for some people when setting up a web server.

With that said, my device is rooted — I did an article showing how to do it — and I am running my all time favorite ROM CyanogenMod — which I also made an article showing how to install it. Needless to say, I highly recommend you to do the same so long as you know what you are doing — that’s where that Linux knowledge comes into play. In any case, the applications I will show you now don’t seem to require a rooted device, but then again, I haven’t checked. So make sure to read the apps respective Play Store page to find out if it requires root privileges or not.

Port Forwarding

The first application I’m gonna be showing you is Port Forwarder and it does what the name says: forwards ports. Just like you would in your router, you can use this app to make a specific port remotely available. If you are familiar with networking and such, I shouldn’t have to explain to you how awesome this is. You can do anything from running a file transfer server to running a game server. If you don’t know how awesome this is, I recommend reading more about it.

Dynamic DNS

This second application is more of a compliment to the first application. The way our smartphones work is by bouncing traffic off communication towers. As you can imagine these towers are all over the place and as we move from point A to point B we must communicate with different towers. What this means is that our IP address is going to be changing… a lot. This is why we need to use a dynamic DNS solution such as No-IP (it’s free). After registering for an account and creating a host, simply install NO-IP Update on your Android device to keep updating your IP address. Then you can simply tell people the DNS address instead of different IP’s all the time… which is also a lot easier to remember.

Web Server

As of today (11/5/2012) there are a few different apps that provide web server functionality for Android devices. I have tried the following two applications which I will show you now — both of which are awesome by the way. I would seriously recommend buying either one of these apps depending on what exactly you are looking for. With that out of the way, let’s check them out!

The first one is kWS. If you are looking for a simple, yet option-rich application this is the way to go. It doesn’t provide support for PHP or MySQL, however, it has many other options that come along with the pro version — only costs $1,99 as of today (11/5/2012). Download the free version and check it out for yourself!

The second application is KSWEB. This web server does provide support for both PHP and MySQL and the full version goes for $2,99 as of today (11/5/2012). Some of the features found in kWS are not present in this application, however, if you absolutely need a database and php, for now, this is the way to go. Note that this app when downloaded for free is a trial for 7 days.

Overall, the best thing to do is download both free version and see how they run in your device. From there you can test both and make a decision if you would like to buy it. Like I said, I would highly recommend these for many reasons. Being a web developer myself, you know how useful this could be. Let’s say your at a hotel and you want to tinker with your website without altering the original version online, just turn on your mobile web server and you’re good to go! 😉

Now hit that full screen and high quality button & enjoy the video!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s