How to Set Up a Webcam Web Page

Man smiling while using a computer
Cavan Images/The Image Bank/Getty Images

Webcams are one of the oldest tricks on the Internet. Back when Netscape was young, our friends used to wander by the Amazing FishCam all the time. It is said to be one of the oldest live cameras on the Internet, starting on or before September 13, 1994.

If you want to set up a webcam of your own, you'll need to get a webcam and some webcam software.

We use a Logitech QuickCam, but you can use any type of webcam you would like. Most of the cameras you buy on the market come with webcam software, but if they don't, you'll need to get software that will both capture the picture and FTP it to your website. Some folks use w3cam for Linux.

Setting up the Webcam Web Page

Many people, when they decide to build a webcam, focus all their time and energy on getting the webcam and the software. But the web page it's on is nearly as important. If you don't have certain things set correctly, your webcam can become a "webcan't".

First, there's the image. Make sure:

  • The image should have a generic filename (no timestamps). We recommend something like
  • Know what size image your camera takes, and use that in the HTML. Don't resize your camera images with the HTML. Images are usually fairly grainy and hard to view, and browser resizing will make that worse.
  • Check your FTP settings and know where the image will be uploaded to.
  • Write your image tag the way you would any valid XHTML image tag. Include height and width and don't forget the alt text:
    • <img src="webcam.jpg" width="200" height="200" border="0" alt="my cam pic" />

Then, there's the web page itself. Your page should automatically reload and it should not be cached. This will ensure that your cam viewers get a new image every time. Here's how you do that:

In the

of your HTML document, place the following two lines:
<meta http-equiv="refresh" content="30" />
<meta http-equiv="expires" content="0" />

In the

meta refresh
tag, if you want your page to refresh less often than every 30 seconds, change the
to something other than 30: 60 (1 minute), 300 (5 minutes), etc. The
tag is important because it affects the cache of web browsers so that the page is not cached but rather pulled from the server on every load.

With these simple tips, you can have a webcam up and running quickly and easily.