In general, we as a population don't think much about storing fuel. After all, with the abundance of gas station popping up in every corner of the globe, it's easy to convince yourself that there will always be a place to get quick and easy access to fuel, but in a survival type situation, this is almost never the case. In the event of a wide-spread emergency, the likelihood of being able to obtain fuel decreases to almost nothing which makes the thought of keeping your own supply on hand very appealing.
However, storing gas and fuel is by no means the same as storing other liquids and previsions. Almost every form of fuel available to the public today is a refined product (made to specifications by human influence) and because of that, fuel does indeed have a shelf life. Though many people may argue that it can be stored indefinitely, even fuel stored to exact specifications will generally only last up to 5 years and fuel stored without proper care will degrade much quicker over time which may make it unable to provide the combustion needed to power cars, trucks, generators, and many other devices.
So how do you make sure you are getting the longest shelf life out of your gasoline and diesel?
First of all, you'll want a sturdy storage container such as the ever popular Nato Jerry Gas Can. The container your choose should be a light color; no blacks or grays that may absorb heat from light, and should have an air-tight seal. Containers should be free of dents, dings, and abrasions for the most part as puckers in the material can cause air pockets that will cause you to lose shelf-life on the fuel stored inside.
Once you have your container, you will want to be sure that you fill it as much as possible. Leaving room in a container will allow air and condensation to form and the last thing you want is water forming inside your fuel so be generous when filling up. Water gives room for life to form and algae in your fuel can have a harsh effect on diesel filters and regulators. ( Most fuels naturally attract water molecules so if you want to keep the contents safe, be sure to keep a close eye on storage conditions)
Now that you have your gas safely stored inside a durable container, you might want to take the extra step of treating the contents with a substance known as algaecide as well as a fuel stabilizer. In order to keep you fuel clean and prolong its use, you will need to make sure that no organisms, living or otherwise, form inside the contents of the can. Generally speaking, commercial fuel and diesel already contains algaecide, but not enough for fuel that is not going to be used within the course of a year.
Even without treatment, diesel should last a solid year without problems as it's make-up is generally stable, but when treated with a fuel stabilizer, you can extend that lifetime to over 5 years. Gasoline on the other hand, will degrade extremely fast if not treated. Unlike diesel, gasoline is refined to the point where it will lose a large amount of octane in only 90 days and will not last without proper care and attention.
Remember, commercial fuel is not treated with the idea that it will be kept for years on end and it's wise to take all the steps you can if you really want it to last.
Also keep in mind that fuel should be treated before it's stored. While treatments can keep fuel going for a long time to come, it will only very rarely bring fuel back from the dead. Keep your containers in a cool dry place and you can rest assured your fuel will be ready when you need it most.