Follow the instructions that come with your tank to purge any air that is currently in it. The inlet valve is typically opened and the air allowed to bleed out. The nitrogen in the tank is kept in place by a one way valve that is opened by the air pressure once the regulator is in place.
Ensure that the tank is completely closed. Check both the inlet and outlet stop cocks to ensure they are completely shut. Use a stiff brush, such as a bottle brush, and soapy water to clean the threads in the tank fitting. Shut off the air pressure to the line you are installing your tank on and bleed the line with a valve to completely depressurize it.
Lay out the parts of your regulator. These may vary, depending on application. Typically the regulator will have at least one elbow running into the tank and a threaded nipple fitted onto the compressor air line. Wrap the threads of each fitting with plumber's tape. Thread the fittings into the threaded holes in the regulator. Tighten fittings with a wrench.
Fit the assembled regulator into the threaded opening in the tank's inlet stop cock and twist it clockwise to tighten it. Finish tightening it with a wrench. Charge the tank with air to test the regulator. Spray soapy water around the fittings to check for leaks, looking for bubbles. Tighten any leaky fittings.
Discharge the air once any leaks are sealed and return the tank to normal usage.