Private Sources
Create and manage custom package sources for WinGet, enabling organizations to distribute internal applications and control package availability.Understanding Sources
WinGet sources provide the package metadata and download locations for applications. While the defaultwinget source serves the public repository, organizations can add private sources for:
- Internal enterprise applications
- Custom package versions
- Approved software catalogs
- Isolated development environments
Source Types
Microsoft.PreIndexed.Package
Pre-indexed package sources (default type):Characteristics
Characteristics
- Uses a pre-built package index
- Optimized for fast searches
- Requires index generation infrastructure
- Recommended for large catalogs
Microsoft.Rest
REST API-based sources:Characteristics
Characteristics
- Dynamic queries via REST API
- No pre-indexing required
- More flexible for smaller catalogs
- Supports custom HTTP headers
Managing Sources
Adding a Source
Identify Source Details
Gather required information:
- Source name (friendly identifier)
- Source URL or UNC path
- Source type (if not default)
Listing Sources
View all configured sources:- Name: Source identifier
- Type: Source type
- Arg: URL or path
- Data: Optional package name
- Updated: Last update timestamp
Updating Sources
Update a specific source:Source updates fetch the latest package index. WinGet automatically updates sources based on the configured interval (default: 15 minutes).
Removing a Source
Remove a source by name:Resetting Sources
Reset to default configuration:Exporting Source Configuration
Export current source configuration:- Backup and restore
- Sharing configuration with team members
- Group Policy configuration
REST Source Configuration
Custom HTTP Headers
Pass custom headers to REST sources for authentication or feature flags:The header is sent as the value of the
Windows-Package-Manager HTTP header to the REST source.Header Limitations
- Maximum length: 1024 characters
- Requires
--sourceto specify a REST source - Ignored for non-REST sources (with warning)
Supported Commands with Headers
Source Priority
When multiple sources contain the same package:Default Behavior
WinGet searches all sources and may prompt for disambiguation:Source Priority Feature
Enable experimental source priority:With source priority enabled, higher-priority sources appear first in search results and are preferred for new installations.
Enterprise Source Deployment
Network Share (UNC Path)
Deploy sources via network shares:Requirements
Requirements
- Share must be accessible to all client machines
- Read permissions for all users
- Network connectivity to file server
- Index files must be kept up-to-date
HTTPS Repository
Secure source hosting:Best Practices
Best Practices
- Use HTTPS for all remote sources
- Implement certificate pinning where possible
- Monitor access logs for anomalies
- Keep source infrastructure patched
Azure Blob Storage
Host package indexes in Azure:Configure blob storage with anonymous read access or integrate authentication via custom headers for REST sources.
Group Policy Integration
Additional Sources Policy
Define sources via Group Policy that users cannot remove:Configure Policy
In Group Policy Editor:
- Navigate to:
Computer Configuration > Administrative Templates > Windows Components > Desktop App Installer - Enable:
Enable Windows Package Manager Additional Sources - Add source with format:
{"Name":"CompanyApps","Arg":"https://...","Type":"Microsoft.PreIndexed.Package"}
Allowed Sources Policy
Restrict users to specific sources only:See the Group Policy Guide for detailed policy configuration.
Building a Private Source
Index Structure Requirements
ForMicrosoft.PreIndexed.Package sources:
- Package manifests: YAML files describing each package
- Index database: SQLite database with package metadata
- Index file:
index.dbat the source root
Manifest Repository
Organize manifests in a repository structure:Index Generation
Use the WinGet source tools to generate indexes:Index generation tools are available in the winget-pkgs repository.
Hosting Considerations
Bandwidth
Sources should handle concurrent client requests. Use CDN for larger deployments.
Update Frequency
Re-generate indexes when manifests change. Automate with CI/CD pipelines.
Versioning
Maintain old package versions in archive for rollback scenarios.
Security
Host over HTTPS, implement access controls, audit package submissions.
REST API Implementation
API Endpoints
Implement these endpoints for a REST source:Search Packages
Search Packages
Endpoint:
GET /packages?query={query}Returns packages matching the search query.Response:Get Package Details
Get Package Details
Endpoint:
GET /packages/{packageId}Returns full manifest for a specific package.Response:Custom Header Processing
Read theWindows-Package-Manager header for custom behavior:
Authentication Strategies
Common Workflows
Multi-Source Installation
Search across all sources but install from specific one:Source-Specific Upgrades
Upgrade packages from a particular source:Testing New Sources
Validate source connectivity before deployment:Troubleshooting
Source Not Updating
Source Not Updating
Symptoms: Packages don’t appear after adding to sourceSolutions:
- Force update:
winget source update --name YourSource - Check network connectivity to source URL
- Verify index file timestamp at source location
- Check firewall/proxy settings
- Remove and re-add source
HTTP 403/404 Errors
HTTP 403/404 Errors
Symptoms: Cannot access sourceSolutions:
- Verify URL is correct
- Check anonymous read permissions
- Test URL in browser
- Review server access logs
- Verify SSL/TLS certificate validity
Duplicate Package Errors
Duplicate Package Errors
Symptoms: Same package ID in multiple sourcesSolutions:
- Always specify
--sourcewhen installing - Use
--exactflag for precise matching - Consider source priority feature
- Review source naming conventions
Index Corruption
Index Corruption
Symptoms: Search returns inconsistent resultsSolutions:
- Regenerate source index
- Clear client cache:
winget source reset - Force source update
- Verify index.db file integrity
Security Best Practices
Use HTTPS
Always use encrypted connections for remote sources. Never expose package repositories over plain HTTP.
Validate Packages
Implement package validation and scanning before adding to private sources.
Access Control
Restrict who can submit packages to your private source. Use authentication and authorization.
Audit Logging
Log all package submissions, modifications, and access attempts for security review.
Hash Verification
Always include SHA256 hashes in manifests. WinGet validates downloads against these hashes.
Network Isolation
Consider network segmentation for internal package repositories.
Performance Optimization
Caching Strategy
Implement caching at multiple levels:- CDN caching: For global deployments
- Proxy caching: For large offices
- Client caching: WinGet automatically caches indexes
Index Optimization
- Keep index files compact
- Remove old package versions periodically
- Implement index file compression
- Use incremental index updates where possible
Bandwidth Management
Related Resources
Group Policy
Enforce source policies across your organization
Configuration Files
Configure source update intervals and behavior
Package Management
Install and manage packages from private sources