How to create a document library in SharePoint Online?
When you create a SharePoint Online site, a default document library is created which stores all the files shared within the site. You can also create additional document libraries by following the steps below.
Create a New Document Library in SharePoint Online
- Navigate to the desired SharePoint Online site. Under the Site contents section, click on "+New" and select Document library.
- Click on Blank library. If you want to use specific templates, you can select the required one from the suggested options.
- Give the library a name and description (optional) based on its purpose. You can also pick a Microsoft 365 sensitivity label to prevent unauthorized users from accessing the files in the library.
- If you want to hide this library from the main page, you can uncheck the "Show in site navigation" checkbox (checked by default). Click on Create.
You can then create, upload, and share files in a document library.
Create a Document Library Using PowerShell
- Connect to SharePoint Online PnP PowerShell using the below cmdlet.
Connect-PnPOnline -Url <DesiredSite’sURL> -Interactive
- Run the below cmdlet to create a document library in SharePoint Online using PowerShell.
New-PnPList -Title "<DocumentLibraryName>" -Template DocumentLibrary -OnQuickLaunch
Run the PowerShell script below to create multiple document libraries in SharePoint Online.
Connect-PnPOnline -Url <DesiredSite’sURL> -Interactive
newlibraries = @("Library1","Library2", "Library3", "Library4")
foreach ($DocumentLibraryName in $newlibraries) { New-PnPList -Title $DocumentLibraryName -Template DocumentLibrary}
AdminDroid provides a convenient way to check recent document library creations by utilizing the Created column.
- You can use the sorting feature to quickly locate both recently created and oldest document libraries in SharePoint Online.
- Handy Hint: Refer to the "Item Count" column to identify the document libraries with the highest number of items. This facilitates the deletion of unwanted files that may contribute to storage issues.