You don’t have to spend an arm and a leg to take great pictures of the night sky. Yes, you’ll get cleaner and sharper images using the best mirrorlerss cameras or DSLRs, but you don’t need professional equipment to get good results — heck, even some phones can shoot astrophotography. Whatever camera you’re using, learning how to photograph stars is all about technique, and beyond changing a few settings in your camera, it’s not too difficult.

But since cameras are at their worst in the dark, photographing the night sky does require some patience and practice. Autofocus, while sometimes possible, is best avoided, while a tripod is a must. The best star photos also require quite a bit of postproduction work to really make them stand out, but there are some simple adjustments that will help make your photos pop. From set-up to edit, here’s how to photograph the night sky, from capturing dreamy star trails to revealing detail in the Milky Way.

Step 1: Get the gear

Star photography doesn’t require the $5,000 camera body that NASA uses, but there are a few items that are musts when it comes to the night sky, starting with a tripod. A tripod stabilizes your camera so that you don’t get a blurry image during a long-exposure shot (more on this later). Even a small table-top tripod can do the trick, although a full-size model will offer more flexibility.

While the camera you use isn’t the most important part of the equation, cameras with larger sensors will have more potential. The best full-frame cameras are known for their high signal-to-noise ratios and great low light performance which will help capture cleaner images in any dark environment, including star photography. There are even cameras designed specifically for astrophotography. Your lens also plays a role, with large-aperture lenses gathering more light for cleaner results — Nikon’s $8,000 Nikkor Z 58mm Noct lens, with it’s massive f/0.95 aperture, is built with star photography in mind.

But even if what you have is an entry-level, crop-sensor DSLR with a kit lens, you can still make it work.

Since you’re shooting in the dark, make sure your phone is charged to use it as a light, or grab an LED flashlight so you can see your camera while you’re setting up. It’s also a good idea to make sure your are familiar with the camera controls before you go out. A camera remote is also helpful, but not necessary (most modern cameras can also be controlled remotely from a smartphone app; check your camera’s manual for the specifics).

Step 2: Plan around the weather

Perhaps it goes without saying, but you can’t shoot stars with a cloudy sky. A less obvious thing to watch out for, however, is the phase of the moon. The light from the full moon can drown out the stars. For best results, plan around the new moon, or simply shoot in the opposite direction of the moon to capture the darkest part of the sky possible.

If you’re imagining a specific landmark with the Milky Way in the background, you’ll also need to plan the shoot around where those stars are at any certain time. This isn’t necessary if you have a location with a good view in every direction (the samples shown here, for example, were all a result of shooting a few test shots, and then finding the largest concentration of stars to find the Milky Way). But, if you’re dreaming up a shot that requires the Milky Way to line up perfectly, an app like PhotoPills can save a lot of hassle.

Step 3: Get out of town

Light pollution from populated areas will wreak havoc on star photography. In dense cities, you might not be able to see the stars at all at night, and that means your camera won’t, either. Even in rural areas, watch out for things like street lights; if you’re too close, the light they cast could show up in your photo.

Below, you can see an example of light pollution affecting the visibility of stars along the horizon.

Step 4: Don’t just look at the sky

You can photograph nothing but the night sky, but including the surrounding landscape creates a sense of just how vast and impressive that sky is. Scout out your location for elements that will ground your shot. Anything from a tree in the foreground to a distant mountain will lend a sense of place and make the photo more intriguing.

There are two different ways to incorporate the landscape into your shot. You can leave the ground as is and expose for the sky, which turns everything into a silhouette. Or, you can use a flashlight or another continuous light source to paint some light onto those foreground elements so they appear in full color with the sky. Again, this is a creative choice, so there’s no right or wrong answer, though light painting might be the more difficult one to master.

Step 5: Set your exposure

Firstly, if you’re using a camera that can shoot RAW images, make sure it’s set to RAW. A RAW file will be much easier to work with compared to a JPEG when we get to the editing step later. Also, if you’re not familiar with manual settings and the exposure triangle, now is a good time to familiarize yourself with aperture, shutter speed, and ISO. You’re going to need to know how to adjust these settings for the best results.

Night sky photography is long-exposure photography — but only to a point. As the stars move across the night sky, an exposure time that’s too long will cause them to blur. To freeze the stars as points of light, keep your shutter speed to no longer than 20 seconds. Use a wide aperture to let in as much light as possible, then increase your ISO only as far as it needs to go. This will probably be in the range of ISO 1,600 to ISO 6,400, depending on your lens.

For revealing detail in the Milky Way, keeping your shutter speed at or below that 20 second mark is key. Go much longer, and you’ll get too much blur. But that’s not the only way to image the stars. Photographing star trails, where you purposefully blur the stars to see the paths they take across the sky, is another option — and this is where your patience really comes in to play. If you thought waiting around for a 20-second exposure was tough, try waiting for 20 minutes. Here, the longer the exposure time the better. You can get away with 15 minutes, but if you really want to show how the stars move across the sky, set your camera to “bulb” mode and leave the shutter open for a couple of hours (it helps to have a remote for this, otherwise you’d have to physically keep the shutter button depressed for the entire length of the exposure). Keep in mind, some entry-level cameras may not have this feature.