First thank you post this useful information. but when create a site collection and click the "Custom" tab the "Solution gallery" not display in SharePoint 2013 Foundation .in the steps which you marked as "This is important part" and "click this" the solution gallery not displayed in the createsite.aspx page. so i go to the Central Administration --> site setting--> solution gallery to upload the template then active it , then go to create the site collection again the template still not display in "Custom" tab. can you help on this ? Thank you so much.