Foamy urine is most often a sign of protein in the urine. The kidneys filter the blood. Their job is to get rid of what we do not need and return what we do need to the blood stream. Protein should be returned to the blood. If you have foamy urine there is a good chance that you have some kind of kidney disease. Foamy urine on a regular basis should be brought to the attention of your doctor. Foamy urine can sometimes be the result of dehydration or even emptying the bladder very quickly. Since you are not drinking water while you are sleeping, you may be slightly dehydrated when you wake up, resulting in foamy urine. If you have no other symptoms and the foaminess does not continue through the day, you have little to worry about.
Cloudy urine is another matter. Cloudy urine causes include bladder infections. In case of a bladder infection, the urine may also have a bad smell to it. The cloudiness and smell are caused by red or white cells in your urine, mucus, or bacteria. Cloudy urine symptoms, along with an urgent need to urinate and urination that is accompanied by burning or pain, and a sense that the bladder has not emptied fully are all symptoms of a urinary tract infection (UTI). Your doctor can perform a simply urine test in the office and prescribe antibiotics if appropriate. Causes of UTI include germs and sexually transmitted disease. Most often, germs that dwell in your bowel migrate to the urethra. They take up residence in the kidneys and bladder, causing infection. Women are much more prone to develop urinary tract infections. Although diabetes can result in urine abnormalities like sugar in the urine, cloudy urine and diabetes to not necessarily go together.