Yes in most jurisdictions you can. It's a very good DIY project and it can be done very safely. First you need to obtain the proper permit. ... Never attempt to do work on, or install gas piping without first checking with local code authorities and obtaining the proper permits.