# Create a Space with custom domains.
kf create-space my-space --domain my-space.my-company.com
# Create a Space that uses unique storage and service accounts.
kf create-space my-space -container-registry gcr.io/my-project --build-service-account myserviceaccount
# Set running and staging environment variables for Apps and Builds.
kf create-space my-space --run-env=ENVIRONMENT=nonprod --stage-env=ENVIRONMENT=nonprod,JDK_VERSION=8
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[],[],null,["# kf create-space\n\n### Name\n\n`kf create-space` - Create a Space with the given name.\n\n### Synopsis\n\n```\nkf create-space NAME [flags]\n```\n\n### Examples\n\n```\n# Create a Space with custom domains.\nkf create-space my-space --domain my-space.my-company.com\n\n# Create a Space that uses unique storage and service accounts.\nkf create-space my-space -container-registry gcr.io/my-project --build-service-account myserviceaccount\n\n# Set running and staging environment variables for Apps and Builds.\nkf create-space my-space --run-env=ENVIRONMENT=nonprod --stage-env=ENVIRONMENT=nonprod,JDK_VERSION=8\n```\n\n### Flags\n\n`--build-service-account=`\u003cvar translate=\"no\"\u003estring\u003c/var\u003e\n\n: Service account that Builds will use.\n\n`--container-registry=`\u003cvar translate=\"no\"\u003estring\u003c/var\u003e\n\n: Container registry built Apps and source code will be stored in.\n\n`--domain=`\u003cvar translate=\"no\"\u003estringArray\u003c/var\u003e\n\n: Sets the valid domains for the Space. The first provided domain is the default.\n\n`-h, --help`\n\n: help for create-space\n\n`--run-env=`\u003cvar translate=\"no\"\u003estringToString\u003c/var\u003e\n\n: Sets the running environment variables for all Apps in the Space.\n\n`--stage-env=`\u003cvar translate=\"no\"\u003estringToString\u003c/var\u003e\n\n: Sets the staging environment variables for all Builds in the Space.\n\n### Inherited flags\n\nThese flags are inherited from parent commands.\n\n`--as=`\u003cvar translate=\"no\"\u003estring\u003c/var\u003e\n\n: Username to impersonate for the operation.\n\n`--as-group=`\u003cvar translate=\"no\"\u003estrings\u003c/var\u003e\n\n: Group to impersonate for the operation. Include this flag multiple times to specify multiple groups.\n\n`--config=`\u003cvar translate=\"no\"\u003estring\u003c/var\u003e\n\n: Path to the Kf config file to use for CLI requests.\n\n`--kubeconfig=`\u003cvar translate=\"no\"\u003estring\u003c/var\u003e\n\n: Path to the kubeconfig file to use for CLI requests.\n\n`--log-http`\n\n: Log HTTP requests to standard error.\n\n`--space=`\u003cvar translate=\"no\"\u003estring\u003c/var\u003e\n\n: Space to run the command against. This flag overrides the currently targeted Space."]]