code: public void createBucket(BucketConfiguration config) throws BucketAlreadyExistsException, IOException {
          if (!config.validate()) {
              throw new IllegalArgumentException("Invalid bucket configuration");
          }
  
          synchronized (buckets) {
              if (buckets.containsKey(config.name)) {
                  throw new BucketAlreadyExistsException(config.name);
              }
  
              Bucket bucket = Bucket.create(this, config);
              BucketAdminServer adminServer = new BucketAdminServer(bucket, httpServer, this);
              adminServer.register();
              bucket.setAdminServer(adminServer);
  
              HttpAuthVerifier verifier = new HttpAuthVerifier(bucket, authenticator);
  
              if (config.type == BucketType.COUCHBASE) {
                  CAPIServer capi = new CAPIServer(bucket, verifier);
                  capi.register(httpServer);
                  bucket.setCAPIServer(capi);
              }
  
              buckets.put(config.name, bucket);
              bucket.start();
          }
      }
docs: Create a new bucket, and start it.
  
  @param config The bucket configuration to use
  @throws BucketAlreadyExistsException If the bucket already exists
  @throws IOException If an I/O error occurs