You can point your camera at the sky in auto exposure and autofocus modes and fire away whenever you see a burst of fireworks, but for the best quality photos, it helps to know a few tricks of the trade. It’s easy when you know what to do.
If the fireworks are against a dark night sky the shutter speed doesn’t matter. Put your camera on a tripod, set the ISO to 100, set the lens aperture to f/8, focus the lens on infinity (and then turn off autofocus), and point your camera at the area of the sky where the fireworks are happening. Put your camera on B (for “bulb”) so you can hold the shutter open as long as you want. Open the shutter and keep it open until you have recorded one or more bursts of fireworks, then close the shutter. Simple!
With a dark night sky as the background the shutter can be open for a long, long time before it starts to record the night sky, so you can hold the shutter open just about as as long as you need to in order to capture one or more bursts of fireworks.
f/8 is a good aperture for recording fireworks with an average level of brightness. If you want your fireworks to look brighter and bolder, try an aperture of f/5.6. If you want the fireworks to look more delicate with finer tracing lines, try f/11. Of course fireworks vary quite a bit in brightness, so there is an element of unpredictability. If your fireworks look too dark in general, try a wider aperture (f/5.6 or f/4) or a faster ISO like 200 or 400. If your fireworks are generally too bright, use a smaller lens aperture like f/11 or f/16. Feel free to experiment and take LOTS of pictures.
One focusing caution. Some zoom lenses focus past infinity. They are designed that way to allow for expansion and contraction of the lens in varying temperatures and at different focal lengths. You will see an “L” shaped mark on your lens at the infinity location on the distance scale. If you aren’t sure exactly where infinity is on your zoom lens, focus on something far away in the day time and see where the focus mark is opposite the distance scale on your lens. If it is at night, focus on something far away like a distant streetlight. Then turn off autofocus so it isn’t hunting for a focus point when looking at the dark sky.
If your camera doesn’t have a “B” setting, set the camera to a long enough shutter speed to capture one or more bursts of fireworks each time you take a picture.
If you don’t have a tripod, crank the ISO up to 800 or 1600 and set the shutter speed to 1/2 or 1 second, hold the camera as steady as you possibly can, and click the shutter just before you think a burst will occur. Listen for the low, resonant “thump” when the fireworks are launched from the ground, and then click the shutter a second or two later.
If the fireworks are over a cityscape, the shutter speed is important because too long a shutter speed will overexpose the cityscape and too short a shutter speed will underexpose the cityscape.
Set your camera on a tripod, set the ISO to 100 and the lens aperture to f/8. Experiment with different shutter speeds to determine a good exposure for the cityscape. With really bright night time scenes like “The Strip” in Las Vegas, a shutter speed of 2 to 4 seconds will be about right. For night scenes with a more average level of brightness, try 8 to 15 seconds. For darker cityscapes, try even longer shutter speeds. Once you have the right shutter speed to give you a nice cityscape, just take pictures over and over again with that shutter speed at f/8 so you can captures the bursts of light. If you fireworks look too light or too dark, you will need to change the aperture to get the right brightness for the fireworks, with a corresponding change in shutter speeds for the cityscape. It will help with timing if you listen for the deep, percussive “thump” when the fireworks are launched from the ground and open the shutter a second or two later to capture the burst up in the sky.
Most fireworks displays don’t happen over a great looking cityscape. Most cities won’t allow fireworks over the best photographic locations (like the The Strip in Las Vegas). That’s ok. Capture the fireworks against the dark night sky and use your computer to digitally add them later to a photo of a nice cityscape. If you are using Photoshop, open the cityscape photo first as your “background” layer. Then open one or more the fireworks photos and drag them on top of the background layer. (It will help if you crop out most of the dark sky around the burst before you drag the burst over the citscape layer.) Set the “blending mode” for the fireworks layers to “Lighten”. Like magic, the black sky in the fireworks layers will disappear, leaving only the burst of fireworks so you can see through the burst to the cityscape layer underneath. Move the fireworks so they are positioned where you want them over your cityscape.
The photo at the top of this page has two separate photos of fireworks (photographed against a black sky) which were digitally added later to the Las Vegas street scene. The MGM Grand sign had a separate exposure to keep it from washing out. So the photo is a composite of four separate images.
Exposure data for the top photo. Las Vegas street scene: Canon 5D, Canon EF 24-105 at 24mm, f/22, 15 sec, ISO 100. MGM Grand sign: Canon 5D, Canon EF 24-105 at 24mm, f/22, 1/6 sec, ISO 100. Right burst: Canon 20D, Canon EF 28-135 at 28mm, f/5.6, 1024 sec, IS0 200.  Left burst: Canon 10D, Canon EF 28-135 at 33mm, f/6.7, 0.7 sec, ISO 1600.
Links
To learn more about night and low light photography, and exposure in general, and a whole lot more, read my new book, Digital Photography Exposure for Dummies. Learn more here and order it at Amazon.com.